Open kai2nenobu opened 3 years ago
Thanks for opening your first issue here! In case you're facing a bug, please update navi to the latest version first. Maybe the bug is already solved! :)
This bug also happens with --best-match
option. In a wide window, navi
automatically selects the target cheat.
However, doesn't in a narrow window
I'm afraid there's no way to fix it with the existing TUI (which uses fzf)
However, --best-match
should have a different behavior. When navi is unable to get a terminal window width (which is the case of a subshell/--best-match
), then navi assumes it's like 99999
.
I'll take a look if this part of the code is buggy.
Oh, I'm sorry to duplicate the issue.
Just a thought, but how about adding a new option that doesn't truncate tags and comments, but simply combines tags, comments, and commands? It won't look good because the columns are not aligned, but it will allow fzf
to search on all words.
There's this workaround: NAVI_TAG_WIDTH=60 NAVI_COMMENT_WIDTH=120 navi
It's ugly, but it will make sure columns are wide enough.
Another workaround is to have lines like this:
<trimmed_tag> <trimmed_comment> <command> <A LOT OF SPACES> <tag> <comment>
The downside is that all lines will contain ...
at the end of the terminal window + if a search matches <comment>
but not <trimmed_comment>
, the results will be quite confusing.
WDYT?
I think your workaround is good and downsides are trivial to me 👍. But how can I achieve the workaround?
Right now, you can't. The next release will probably include this workaround and you'll be able to enable it using a config flag.
Describe the bug
When tags or comments are truncated in a narrow window,
navi
cannot search cheats with truncated tags or comments.To Reproduce
navi repo add denisidoro/cheats
unixporn
orpenguin
Expected behavior
navi
shows this cheat in candidates.Screenshots
The target cheat is shown with no query.
Query with
penguin
in a narrow window (around 100 columns)Query
unixporn
in a narrow window (around 100 columns)Query
penguin
in a wide window (around 180 columns)Query
unixporn
in a wide winodw (around 180 columns)Versions: