Closed contentfree closed 1 year ago
I'm still trying to recreate the actual bug I'm witnessing in my normal zshrc where it's inserting up-.sh
but the above does illustrate a similar issue where the unambiguous part is not inserted.
First off, you're getting the zstyle
selector wrong. Have another look at the documentation. The word tab
shouldn't be in there.
Secondly, it doesn't say anywhere that only a common prefix would be inserted. Zsh's (somewhat awkwardly-named) "unambiguous" string is actually the you the longest possible string that, given the current matcher
, unambiguously completes to all listed completions. Calling it the "common substring" is just my attempt at finding a better word for this.
So, not a bug. Working as expected.
First off, you're getting the
zstyle
selector wrong. Have another look at the documentation. The wordtab
shouldn't be in there.
Ah, I got that from a comment you made in Discussions (https://github.com/marlonrichert/zsh-autocomplete/discussions/205#discussioncomment-451735) where you said:
What you want is:
zstyle ':autocomplete:tab:*' insert-unambiguous yes
And as far as misinterpreting common string as common prefix, that was from bug Tab autocompletion picks first item instead of the longest common prefix and you seemed to be stating that their misconfiguration was the cause of the common prefix not being inserted. And not that the expectation that a common prefix would be inserted was wrong.
Where would inserting the full common substring be useful? (Not disagreeing; curious.) Maybe when doing a copy or something and not navigation. Is it possible to change the behavior to only insert the common prefix when navigating?
Ah, I got that from a comment you made in Discussions (https://github.com/marlonrichert/zsh-autocomplete/discussions/205#discussioncomment-451735) where you said:
That discussion is almost 3 years old. Things have changed. 🙂
Where would inserting the full common substring be useful?
I don't find it useful at all, but then again, I don't find inserting the common prefix useful either. 🤷🏽♂️
Anyway, if you want to change this behavior, then you need to customize the matcher-list
setting. Adding an empty ''
as the first item in the list might do the trick; not sure. In any case, I won't change this in Autocomplete's config.
Environment
Steps to reproduce
Note the suggested common substring is not the common prefix but the entire string common to both. Hitting above inserts actually inserts
up-dev.sh
and notup-
. (And in my full normal zshrc profile,up-.sh
which is the genesis of this bug report.)~autocomplete-log/YYYY-MM-DD.log
(click to expand)(log file was empty… additionally, typing did not insert the unambiguous part but instead completed to the first item
~autocomplete
shows two directories:autocomplete autocomplete-log
and pushingautocomplete/
)