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

Closed
xiaq opened this Issue Mar 14, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@xiaq
Member

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 type:bug label Mar 14, 2018

@xiaq xiaq added this to the 0.12 milestone Mar 14, 2018

@xiaq xiaq closed this in 46f995e Mar 15, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment