[vim/vim] fix(completion): avoid break defaul compleition mode (PR #15010)

8 views
Skip to first unread message

glepnir

unread,
Jun 15, 2024, 5:36:28 AM (12 days ago) Jun 15
to vim/vim, Subscribed

currently we fuzzy search item in match array. so if array is empty we should still find from list. avoid broken default completion behavior.

it's part of #14976, seems like #14976 need some dicussions so split it to a single pr

Fix #15009


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

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

Commit Summary

  • cb90651 fix(completion): avoid break defaul compleition mode

File Changes

(2 files)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/15010@github.com>

glepnir

unread,
Jun 15, 2024, 7:37:05 AM (12 days ago) Jun 15
to vim/vim, Push

@glepnir pushed 1 commit.

  • 15e990e fix(completion): avoid break defaul compleition mode


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/15010/before/cb9065156bd0bf5510e767e1d9da2f7cc24ab662/after/15e990ec6963b97542a3f25016f97db01df83f0f@github.com>

zeertzjq

unread,
Jun 15, 2024, 8:19:30 AM (12 days ago) Jun 15
to vim/vim, Subscribed

@zeertzjq commented on this pull request.


In src/testdir/test_ins_complete.vim:

> @@ -2573,6 +2573,15 @@ func Test_complete_fuzzy_match()
   call feedkeys("S\<C-x>\<C-o>fb\<C-n>", 'tx')
   call assert_equal('fooBaz', g:word)
 
+  " avoid break default completion behavior
+  set completeopt=fuzzy,menu
+  call setline(1, ['hello help hero h'])
+  exe "normal A\<C-N>"

Will using \<C-X>\<C-N> here be better?


In src/testdir/test_ins_complete.vim:

> @@ -2573,6 +2573,15 @@ func Test_complete_fuzzy_match()
   call feedkeys("S\<C-x>\<C-o>fb\<C-n>", 'tx')
   call assert_equal('fooBaz', g:word)
 
+  " avoid break default completion behavior
+  set completeopt=fuzzy,menu
+  call setline(1, ['hello help hero h'])
+  exe "normal A\<C-N>"
+  call assert_equal('hello help hero hello', getline('.'))
+  set completeopt+=noinsert
+  exe "normal Shello help hero h\<C-N>"

ditto


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/15010/review/2120401658@github.com>

glepnir

unread,
Jun 15, 2024, 8:28:51 AM (12 days ago) Jun 15
to vim/vim, Push

@glepnir pushed 1 commit.

  • e602fa3 fix(completion): avoid break defaul compleition mode

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/15010/before/15e990ec6963b97542a3f25016f97db01df83f0f/after/e602fa3d536c179a7c9e2d37891f1f277da36ff5@github.com>

Christian Brabandt

unread,
Jun 15, 2024, 9:29:09 AM (12 days ago) Jun 15
to vim/vim, Subscribed

Closed #15010 via aced8c2.


Reply to this email directly, view it on GitHub.

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

Reply all
Reply to author
Forward
0 new messages