[vim/vim] fix(completion): reset shown to first when leader delete to empty (PR #14854)

12 views
Skip to first unread message

glepnir

unread,
May 26, 2024, 7:31:22 AMMay 26
to vim/vim, Subscribed

Problem: when delete leader to empty it still select before shown_match

Solution: restore to first_match.


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

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

Commit Summary

  • ef9bced fix(completion): reset shown to first when leader delete to empty

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/14854@github.com>

zeertzjq

unread,
May 26, 2024, 8:06:36 AMMay 26
to vim/vim, Subscribed

@zeertzjq commented on this pull request.


In src/insexpand.c:

> +    if (compl_started && compl_leader != NULL && *compl_leader == NUL)
+    {
+	compl_shown_match = compl_no_select ? compl_first_match
+					    : compl_first_match->cp_next;
+    }
+

It seems that the message at the bottom is not updated.


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/14854/review/2079591683@github.com>

glepnir

unread,
May 26, 2024, 8:08:24 AMMay 26
to vim/vim, Subscribed

@glepnir commented on this pull request.


In src/testdir/dumps/Test_pum_with_preview_win.dump:

>  |~+0#4040ff13&| @73
 |~| @73
 |[+1#0000000&|S|c|r|a|t|c|h|]| |[|P|r|e|v|i|e|w|]| @37|1|,|1| @11|A|l@1
-|o+0&&|n|e> @71
-|o+0#0000001#e0e0e08|n|e| @11| +0#4040ff13#ffffff0@59
-|t+0#0000001#ffd7ff255|w|o| @11| +0#4040ff13#ffffff0@59
+|t+0&&|w|o> @71

emm seems like not correct.. wired i tried with minimal test.vim and build vim i can't reproduce it ?


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/14854/review/2079591986@github.com>

glepnir

unread,
May 26, 2024, 8:11:35 AMMay 26
to vim/vim, Subscribed

@glepnir commented on this pull request.


In src/insexpand.c:

> +    if (compl_started && compl_leader != NULL && *compl_leader == NUL)
+    {
+	compl_shown_match = compl_no_select ? compl_first_match
+					    : compl_first_match->cp_next;
+    }
+

okay .. thanks


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/14854/review/2079593953@github.com>

glepnir

unread,
May 26, 2024, 8:25:51 AMMay 26
to vim/vim, Push

@glepnir pushed 1 commit.

  • fe150c3 fix(completion): reset shown to first when leader delete to empty


View it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14854/push/18591416393@github.com>

Philip H.

unread,
May 26, 2024, 8:36:56 AMMay 26
to vim/vim, Subscribed

test.vim has to be under testdir and Filelist needed updated.


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/14854/c2132205522@github.com>

Christian Brabandt

unread,
May 26, 2024, 12:12:37 PMMay 26
to vim/vim, Subscribed

@chrisbra commented on this pull request.


In src/testdir/test_ins_complete.vim:

> -      funct Omni_test(findstart, base)
-	if a:findstart
-	  return col(".") - 1
-	endif
-	return [#{word: "one", info: "1info"}, #{word: "two", info: "2info"}, #{word: "three", info: "3info"}]
-      endfunc
-      set omnifunc=Omni_test
-      set completeopt+=longest
+    funct Omni_test(findstart, base)
+      if a:findstart
+        return col(".") - 1
+      endif
+      return [#{word: "one", info: "1info"}, #{word: "two", info: "2info"}, #{word: "three", info: "3info"}]
+    endfunc
+    set omnifunc=Omni_test
+    set completeopt+=longest,noselect

why are you adding noselect here?


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/14854/review/2079685889@github.com>

glepnir

unread,
May 27, 2024, 5:39:12 AMMay 27
to vim/vim, Push

@glepnir pushed 1 commit.

  • 28bfa7d fix(completion): reset shown to first when leader delete to empty


View it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14854/push/18601215511@github.com>

Christian Brabandt

unread,
May 27, 2024, 9:10:33 AMMay 27
to vim/vim, Subscribed

thanks!


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/14854/c2133453639@github.com>

Christian Brabandt

unread,
May 27, 2024, 9:30:56 AMMay 27
to vim/vim, Subscribed

Closed #14854 via 53387c5.


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/14854/issue_event/12946130656@github.com>

Reply all
Reply to author
Forward
0 new messages