tig
tig copied to clipboard
Highlight search term in grep view
It would be nice if in the grep
view the search term would be highlighted.
Currently you have to first grep
for asdf
and then /
for asdf
in the grep
view.
Would be nice if the search term would immediately be highlighted like if searched or maybe better just with some other foreground color so that you can additionally search without confusion.
When you run tig grep
, the grep pattern is preloaded as the search pattern, you just have to press n
to highlight all the occurrences.
Besides that it would still be nice to have the search term highlighted independent of search so that you can search additionally, the functionality you describe seems to be broken.
tig grep asdf
followed by n
says "No match found for 'bcec5204d788d56c7ba919c7b56cb0347a1dca0e'".
which actually is the last commit I went to with :bcec5204d788d56c7ba919c7b56cb0347a1dca0e
in the previous Tig session.
If I do :q
and then again tig grep asdf
and then n
it searches for occurrences of "q".
And actually you would also need special handling for grep options in either case, I can thankfully at least do tig grep -i asdf
or within running tig g
followed by -i asdf
to at least to the grep case-insensitively.
My bad, the pattern is preloaded when doing tig -G
or tig --grep
but not tig grep
. Taking grep options into account might be challenging...
Hmm, ...
$ tig -G ersion
tig: No revisions match the given arguments.
$ tig --grep ersion
tig: No revisions match the given arguments.
Tig does not implement the full command line parser of Git so you have to use tig -Gersion
and tig --grep=ersion
.
Oh, I see. One more questions to that if you allow. Is there any chance you would enhance the command line parser to be more git-like? This difference feels a bit unexpected, especially if you are used to use spaces for the git command options. I don't see a feature request for that, would it make sense to open one or would you not consider it anyway?
Honestly, no. While it does not implement the full command line parser of Git, Tig still has to triage the parameters to give to the Git commands only the one they accept. Allowing separate arguments would be much more complex and the benefit not worth the time spent to implement it.