diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2019-08-30 18:15:36 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2019-08-30 18:15:36 +0000 |
| commit | f24a40a3912713199473eec9452c047c28847f56 (patch) | |
| tree | 1cb7f2fdd891183a8a68e81e8d01ae84293ce404 | |
| parent | search: make search-direction configurable (diff) | |
search: ctrl+s searches forward
| -rw-r--r-- | search.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -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--; |
