summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 13740b3)
raw | patch | inline | side by side (parent: 13740b3)
author | J. Alexander Treuman <jat@spatialrift.net> | |
Sun, 21 Sep 2008 19:37:42 +0000 (21:37 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Sun, 21 Sep 2008 19:37:42 +0000 (21:37 +0200) |
Adding some GNU readline-style binds. These are ^B/^F to move the cursor
back/forward, and ^N/^P to go to the next/previous line.
back/forward, and ^N/^P to go to the next/previous line.
src/wreadln.c | patch | blob | history |
diff --git a/src/wreadln.c b/src/wreadln.c
index ed8ad9a390230bd861ba8597296c7ba5bd83f557..dc1dfe86708f629d8eeb80bff240e03df6c20b86 100644 (file)
--- a/src/wreadln.c
+++ b/src/wreadln.c
#endif
#define KEY_CTRL_A 1
+#define KEY_CTRL_B 2
#define KEY_CTRL_C 3
-#define KEY_CTRL_D 4
+#define KEY_CTRL_D 4
#define KEY_CTRL_E 5
+#define KEY_CTRL_F 6
#define KEY_CTRL_G 7
#define KEY_CTRL_K 11
+#define KEY_CTRL_N 14
+#define KEY_CTRL_P 16
#define KEY_CTRL_U 21
#define KEY_CTRL_Z 26
#define KEY_BCKSPC 8
return NULL;
case KEY_LEFT:
+ case KEY_CTRL_B:
cursor_move_left(&cursor, &start);
break;
case KEY_RIGHT:
+ case KEY_CTRL_F:
cursor_move_right(&cursor, &start, width, x0, x1, line);
break;
case KEY_HOME:
}
break;
case KEY_UP:
+ case KEY_CTRL_P:
/* get previous history entry */
if( history && hlist->prev ) {
if( hlist==hcurrent )
cursor_move_to_eol(&cursor, &start, width, x0, x1, line);
break;
case KEY_DOWN:
+ case KEY_CTRL_N:
/* get next history entry */
if( history && hlist->next ) {
/* get next line */