Skip to content

Fix subsequence-based unambiguous completion - #576

Open
MahdiNazemi wants to merge 1 commit into
Aloxaf:masterfrom
MahdiNazemi:fix-unambiguous-literal
Open

Fix subsequence-based unambiguous completion#576
MahdiNazemi wants to merge 1 commit into
Aloxaf:masterfrom
MahdiNazemi:fix-unambiguous-literal

Conversation

@MahdiNazemi

Copy link
Copy Markdown

Summary

When matcher-list enables subsequence matching, zsh can compute a compstate[unambiguous] value that is not a contiguous substring of every candidate. fzf-tab currently trusts that value and inserts it, which can bias completion toward one candidate instead of showing the fzf menu.

This change validates the unambiguous insertion against the captured completion words first. If the proposed insertion is not contiguous in every matched word, fzf-tab falls through to the normal fzf candidate list.

Closes #560.

Tests

  • zsh -n fzf-tab.zsh test/fzftab.ztst test/runtests.zsh test/comptest
  • cd test && zsh runtests.zsh fzftab.ztst
  • Verified the new regression fails on current upstream by inserting somedir/k_1234, and passes with this patch by showing both candidates.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG?] fzf never shown when subsequence-based unambiguous expansion biases toward a single match

1 participant