Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

edit:completion:smart-start is wrong when using non-prefix matcher #637

xiaq opened this issue Mar 14, 2018 · 0 comments

edit:completion:smart-start is wrong when using non-prefix matcher #637

xiaq opened this issue Mar 14, 2018 · 0 comments


Copy link

xiaq commented Mar 14, 2018

The current algorithm used by edit:completion:smart-start is that if there is a common prefix of all candidates, then instead of starting the completion mode, it merely completes up to the common prefix. This is consistent with the default behavior of more traditional shells like bash.

This behavior, however, is confusing or even wrong when not using the default prefix matcher. An example given by @occivink: pwd contains files pref1abc, pref2abc, pref1def and pref2def, and using the substring matcher. If the user types abc, the candidates are pref1abc and pref2abc, the common prefix being pref. Hence, edit:completion:smart-start completes pref. This is not helpful at all!

The easiest way to resolve this is to make smart-start less smart. Instead of trying to complete the common prefix, only check if there is just one candidate, and start the completion mode in all other cases.

@xiaq xiaq added the bug label Mar 14, 2018
@xiaq xiaq added this to the 0.12 milestone Mar 14, 2018
@xiaq xiaq closed this as completed in 46f995e Mar 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

1 participant