aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-08-30 18:15:36 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-08-30 18:15:36 +0000
commitf24a40a3912713199473eec9452c047c28847f56 (patch)
tree1cb7f2fdd891183a8a68e81e8d01ae84293ce404
parentsearch: make search-direction configurable (diff)
search: ctrl+s searches forward
-rw-r--r--search.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/search.c b/search.c
index 21059f41..28a24367 100644
--- a/search.c
+++ b/search.c
@@ -339,6 +339,24 @@ search_input(struct terminal *term, uint32_t key, xkb_keysym_t sym, xkb_mod_mask
}
}
+ else if (mods == ctrl && sym == XKB_KEY_s) {
+ if (term->search.match_len > 0) {
+ int new_col = term->search.match.col + 1;
+ int new_row = term->search.match.row;
+
+ if (new_col >= term->cols) {
+ new_col = 0;
+ new_row++;
+ }
+
+ if (new_row < term->grid->num_rows) {
+ term->search.match.col = new_col;
+ term->search.match.row = new_row;
+ term->search.direction = SEARCH_FORWARD;
+ }
+ }
+ }
+
else if (mods == 0 && sym == XKB_KEY_Left) {
if (term->search.cursor > 0)
term->search.cursor--;