Description
Is your feature request related to a problem? Please describe.
Often views of diffs, or file blames, or commit lists are very long. Quickly finding some element or piece of text is a common need, and a very useful feature.
Describe the solution you'd like
I'd like a generalized search functionality. The input text should be visible in the command bar. Any view that has text items should eventually implement searching and/or filtering (help included). Ideally, it should be unified with the fuzzy file finder, but it doesn't have to be.
- When I press
/
, type some text, and hit return the current view should scroll to the first textual match, and that textual match should be distinctly highlighted. n
andShift-n
should cycle between matches, changing the highlight.- optionally,
Shift-/
(?
) can search in reverse Ctrl-/
(or another combo) should instead filter the view by the text input.- A view that supports filtering, should make it clear that it is in a filtered mode, possibly by changing highlights (fuzzy file finder does a good job here, and something like that would be nice for commits, or filtering diff chunks that contain that substring)
Describe alternatives you've considered
Using tig
😄
Additional context
Similar issues: #429, #449, #990, #1113, #1350
There seems to be some effort and interest already in this, given gitui
has a nice fuzzy file finder, #672 was being worked on.
After some local prototyping, I'd suggest that search/filter input be a per-app global, and only be available when the current component signals it knows how to search/filter. This may imply that search/filter either be added to the Component
trait, or be treated like an event.