Skip to content

Conversation

@quark-zju
Copy link
Contributor

@quark-zju quark-zju commented Jul 21, 2021

Preview search as user types. Similar to vim's hlsearch. This seems especially useful when using complex regexps.

This can replace `set_` APIs to make the APIs on Pager cleaner.
It makes the next change skip adding the `set_` API.
Make it possible to scroll_to a line without centering it. This will be
used by the next change.
Similar to the hlsearch feature from vim, show search results as user
types. This can be turned off via a config.
If the matched line is already in the current view, do not center it.
This reduces scrolling in search live preview.

It seems to be a general good default so I didn't add a config option.
This resolves some rendering issues where the search and prompt bar does
not get re-rendered properly. Repro steps:

1. sp src/screen.rs.
2. Search for 'crate'. 'crate' gets highlighted.
3. Search for 'foo' (no result). Keep the prompt.
4. Ctrl+W. Prompt does not erase the 'foo'. Search status shows 'foo'
   instead of expecte 'crate'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant