From a3867458afd4f9e87d78764d04fa945126e1c23b Mon Sep 17 00:00:00 2001 From: Daniel Carl Date: Sun, 13 Oct 2013 17:52:50 +0200 Subject: [PATCH] Added CTRL-V to pass the next key without mapping. --- doc/vimb.1 | 18 ++++++++++++++++++ src/mode.c | 17 +++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/doc/vimb.1 b/doc/vimb.1 index 46348ea..a0f6b43 100644 --- a/doc/vimb.1 +++ b/doc/vimb.1 @@ -78,6 +78,9 @@ Toggle show html source of current page. .B g\-F Opend the Web Inspector for current page. .TP +.B CTRL\-V +Pass the next key press directly to gtk. +.TP .B CTRL\-Q Quit the browser. @@ -325,6 +328,9 @@ Moves the cursor direct behind the prompt `:'. .TP .B CTRL\-E Moves the cursor after the char in inputbox. +.TP +.B CTRL\-V +Pass the next key press directly to gtk. .SS Command Line History .TP @@ -508,6 +514,18 @@ value. Example: ":eval document.cookie" +.SH INPUT MODE + +.TP +.B , CTRL\-[ +Switch back to normal mode. +.TP +.B CTRL\-T +Open configured editor with content of current form field. +.TP +.B CTRL\-Z +Enter the pass-through mode. + .SH COMPLETIONS The completions are triggered by pressing `` or `` in the activated inputbox. Depending of the current inserted content different diff --git a/src/mode.c b/src/mode.c index 4d9ef08..ebf2969 100644 --- a/src/mode.c +++ b/src/mode.c @@ -20,6 +20,7 @@ #include "config.h" #include "main.h" #include "mode.h" +#include "normal.h" static GHashTable *modes = NULL; extern VbCore vb; @@ -95,6 +96,22 @@ void mode_enter(char id) VbResult mode_handle_key(int key) { VbResult res; + static gboolean ctrl_v = false; + + if (ctrl_v) { + vb.state.processed_key = false; + ctrl_v = false; + + return RESULT_COMPLETE; + } + if (key == CTRL('V')) { + vb.mode->flags |= FLAG_NOMAP; + ctrl_v = true; + normal_showcmd(key); + + return RESULT_MORE; + } + if (vb.mode && vb.mode->keypress) { #ifdef DEBUG int flags = vb.mode->flags; -- 2.20.1