Allow basic motion commands for hinting too.
authorDaniel Carl <danielcarl@gmx.de>
Fri, 27 Apr 2018 22:35:34 +0000 (00:35 +0200)
committerDaniel Carl <danielcarl@gmx.de>
Fri, 27 Apr 2018 22:35:34 +0000 (00:35 +0200)
doc/vimb.1
src/ascii.h
src/hints.c

index cdcfd85..7504fab 100644 (file)
@@ -297,6 +297,35 @@ remain visible so that another one can be selected with the same action
 as the first.
 Note that the extended hint mode can only be combined with the following
 hint modes \fII o p P s t y Y\fP.
+.PD
+.TP
+.B Motion
+.RS
+Motions commands are like those for normal mode except that CTRL is used as
+modifier.
+But they can not be used together with a count.
+.PP
+.PD 0
+.TP
+.B CTRL-F
+Scroll one page down.
+.TP
+.B CTRL-B
+Scroll one page up.
+.TP
+.B CTRL-D
+Scroll half page down.
+.TP
+.B CTRL-U
+Scroll half page up.
+.TP
+.B CTRL-J
+Scroll one step down.
+.TP
+.B CTRL-K
+Scroll one step up.
+.PD
+.RE
 .SS Searching
 .TP
 .BI / QUERY ", ?" QUERY
index cd47876..92906c7 100644 (file)
@@ -78,6 +78,7 @@ static const unsigned char chartable[256] = {
 
 /* get internal representation for conrol character ^C */
 #define CTRL(c)             ((c) ^ 0x40)
+#define UNCTRL(c)           (((c) ^ 0x40) + 'a' - 'A')
 
 #define IS_SPECIAL(c)       (c < 0)
 
index 8905ec3..c5be1d8 100644 (file)
@@ -29,6 +29,7 @@
 #include "command.h"
 #include "input.h"
 #include "map.h"
+#include "normal.h"
 #include "ext-proxy.h"
 
 static struct {
@@ -74,6 +75,10 @@ VbResult hints_keypress(Client *c, int key)
         hints_focus_next(c, TRUE);
 
         return RESULT_COMPLETE;
+    } else if (key == CTRL('D') || key == CTRL('F') || key == CTRL('B') || key == CTRL('U')) {
+        return normal_keypress(c, key);
+    } else if (key == CTRL('J') || key == CTRL('K')) {
+        return normal_keypress(c, UNCTRL(key));
     } else {
         fire_timeout(c, TRUE);
         /* try to handle the key by the javascript */