aboutsummaryrefslogtreecommitdiff
path: root/search.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-08-30 18:55:45 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-08-30 18:55:45 +0000
commite2aeb7e5151a418c44c9fafc12da25218ccf586f (patch)
tree67a3f1a0f6115accbb4eb6eb37239c61f558cee3 /search.c
parentman: document keyboard + mouse shortcuts (diff)
search: map ctrl+b/f to move cursor single character backward/forward
Diffstat (limited to 'search.c')
-rw-r--r--search.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/search.c b/search.c
index 28a24367..45ca675e 100644
--- a/search.c
+++ b/search.c
@@ -357,7 +357,9 @@ search_input(struct terminal *term, uint32_t key, xkb_keysym_t sym, xkb_mod_mask
}
}
- else if (mods == 0 && sym == XKB_KEY_Left) {
+ else if ((mods == 0 && sym == XKB_KEY_Left) ||
+ (mods == ctrl && sym == XKB_KEY_b))
+ {
if (term->search.cursor > 0)
term->search.cursor--;
}
@@ -371,7 +373,9 @@ search_input(struct terminal *term, uint32_t key, xkb_keysym_t sym, xkb_mod_mask
assert(term->search.cursor <= term->search.len);
}
- else if (mods == 0 && sym == XKB_KEY_Right) {
+ else if ((mods == 0 && sym == XKB_KEY_Right) ||
+ (mods == ctrl && sym == XKB_KEY_f))
+ {
if (term->search.cursor < term->search.len)
term->search.cursor++;
}