[vim/vim] completion list is miss sorted after complete() (PR #21103)

9 views
Skip to first unread message

glepnir

unread,
Aug 20, 2026, 4:07:05 AM (6 days ago) Aug 20
to vim/vim, Subscribed

Problem: With 'completeopt' "fuzzy", a resort after complete() leaves the
last match unsorted at the end of the list.
Solution: Find the original text by its flag instead of assuming
compl_shows_dir points at it.


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/21103

Commit Summary

  • 493bc99 completion list is miss sorted after complete()

File Changes

(2 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/21103@github.com>

Christian Brabandt

unread,
Aug 20, 2026, 2:16:19 PM (5 days ago) Aug 20
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#21103)

Thanks, I see the test currently fails, so changing the if condition is probably right.
However, I am slightly worried about the new else case. It doesn't cut off the leader anymore (as the function comment claims) and there does not seem to be a test for this. And finally I'd say the test should not leave out the first byte of the line but compare the whole line directly.

So I don't think this is ready yet.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/21103/c5359913706@github.com>

glepnir

unread,
Aug 20, 2026, 11:45:38 PM (5 days ago) Aug 20
to vim/vim, Subscribed
glepnir left a comment (vim/vim#21103)

Resolved.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/21103/c5364931954@github.com>

h_east

unread,
Aug 24, 2026, 6:33:00 AM (yesterday) Aug 24
to vim/vim, Subscribed
h-east left a comment (vim/vim#21103)

The force-push took care of the test comparing the whole line. The else case
is untouched, though, so that one still looks open to me.

It unlinks compl_first_match->cp_prev and puts it back at the tail, which is
right only while that node is the original text. Nothing checks that it is.
ins_compl_set_original_text() has the same node to find and looks at both
ends for it, doing nothing when neither matches (insexpand.c:2829). Doing that
here as well, or pulling the search into a helper both of them use, would put
the assumption in the code rather than leave it implied.

compl_T *compl = NULL; -- the initialization is never read, compl is
assigned two lines further down.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/21103/c5393989540@github.com>

Christian Brabandt

unread,
4:09 PM (5 hours ago) 4:09 PM
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#21103)

thanks


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/21103/c5416094787@github.com>

Reply all
Reply to author
Forward
0 new messages