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
This commit is contained in:
Daniel Eklöf 2023-09-26 17:54:03 +02:00
parent 56d5d4cc21
commit 78665a7e80
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
6 changed files with 457 additions and 106 deletions

View file

@ -60,9 +60,20 @@
row ([#1364][1364]).
* Support for DECSET/DECRST/DECRQM 2027 (_Grapheme cluster
processing_).
* New search mode key bindings (along with their defaults)
([#419][419]):
- `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+alt+shift+left)
- `extend-line-up` (shift+up)
- `scrollback-up-page` (shift+page-up)
- `scrollback-down-page` (shift+page-down)
[1077]: https://codeberg.org/dnkl/foot/issues/1077
[1364]: https://codeberg.org/dnkl/foot/issues/1364
[419]: https://codeberg.org/dnkl/foot/issues/419
### Changed
@ -111,6 +122,8 @@
turned off and then back on again) ([#1498][1498]).
* Transparency in margins (padding) not being disabled in fullscreen
mode ([#1503][1503]).
* Crash when a scrollback search match is in the last column.
* Scrollback search: grapheme clusters not matching correctly.
[1436]: https://codeberg.org/dnkl/foot/issues/1436
[1464]: https://codeberg.org/dnkl/foot/issues/1464