From 78665a7e809afd470e1236867761d51de9737eaa Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Tue, 26 Sep 2023 17:54:03 +0200 Subject: search: add more key bindings to extend the current match This patch adds the following new search key bindings: * extend-char (shift+right) * extend-line-down (shift+down) * extend-backward-char (shift+left) * extend-backward-to-word-boundary (ctrl+shift+left) * extend-backward-to-next-whitespace (ctrl+shift+alt+left) * extend-line-up (shift+up) They can be used to extend the search match (i.e. the selection). This patch also adds an initial set of key bindings to scroll in the scrollback history: * scrollback-up-page * scrollback-down-page These work just like the key bindings for the normal mode. Also note that it was already possible to scroll using the mouse. This patch also fixes a couple of search mode bugs: * crashing when a search match ends in the last column * grapheme clusters not being matched correctly * Search match not being "extendable" after a pointer leave event * A few others, related to either large matches, or extending matches after moving the viewport. There are still a couple of (known) issues: * A search match isn't correctly highlighted if its *starting* point is outside the viewport. * Extending the match to end of the scrollback (i.e. the most recent output) is simply buggy. Related to #419 --- selection.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'selection.h') diff --git a/selection.h b/selection.h index c6d7f968..26298457 100644 --- a/selection.h +++ b/selection.h @@ -78,9 +78,9 @@ void selection_start_scroll_timer( void selection_stop_scroll_timer(struct terminal *term); void selection_find_word_boundary_left( - struct terminal *term, struct coord *pos, bool spaces_only); + const struct terminal *term, struct coord *pos, bool spaces_only); void selection_find_word_boundary_right( - struct terminal *term, struct coord *pos, bool spaces_only, + const struct terminal *term, struct coord *pos, bool spaces_only, bool stop_on_space_to_word_boundary); struct coord selection_get_start(const struct terminal *term); -- cgit v1.3