]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1454: tests: no test for pum at line break position v9.1.1454
authorglepnir <glephunter@gmail.com>
Wed, 11 Jun 2025 19:14:02 +0000 (21:14 +0200)
committerChristian Brabandt <cb@256bit.org>
Wed, 11 Jun 2025 19:14:02 +0000 (21:14 +0200)
Problem:  Missing test case for pum display on a wrapped line.
Solution: Add a test case to cover pum behavior at line break positions.
          (glepnir)

closes: #17520

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/testdir/dumps/Test_pum_wrap_line1.dump [new file with mode: 0644]
src/testdir/dumps/Test_pum_wrap_line2.dump [new file with mode: 0644]
src/testdir/dumps/Test_pum_wrap_line3.dump [new file with mode: 0644]
src/testdir/dumps/Test_pum_wrap_line4.dump [new file with mode: 0644]
src/testdir/dumps/Test_pum_wrap_line5.dump [new file with mode: 0644]
src/testdir/test_popup.vim
src/version.c

diff --git a/src/testdir/dumps/Test_pum_wrap_line1.dump b/src/testdir/dumps/Test_pum_wrap_line1.dump
new file mode 100644 (file)
index 0000000..d4d3ea5
--- /dev/null
@@ -0,0 +1,15 @@
+|a+0&#ffffff0|b|c|d|e> |a|b|c|d|e| |a|b|c|d|e| |a|b|c|d|e| |a
+|b|c|d|e| |a|b|c|d|e| |a|b|c|d|e| |a|b|c|d|e| |a|b
+|c|d|e| |a|b|c|d|e| |a|b|c|d|e| |a|b|c|d|e| |a|b|c
+|d|e| |a| +0#0000001#e0e0e08|f|o@1| @11| +0#0000000#ffffff0|a|b|c|d
+|e| |a|b| +0#0000001#ffd7ff255|b|a|r| @11| +0#0000000#ffffff0@4
+|~+0#4040ff13&| @2| +0#0000001#ffd7ff255|f|o@1|b|a|r| @8| +0#4040ff13#ffffff0@4
+|~| @23
+|~| @23
+|~| @23
+|~| @23
+|~| @23
+|~| @23
+|~| @23
+|~| @23
+|-+2#0000000&@1| |m+0#00e0003&|a|t|c|h| |1| |o|f| |3| +0#0000000&@9
diff --git a/src/testdir/dumps/Test_pum_wrap_line2.dump b/src/testdir/dumps/Test_pum_wrap_line2.dump
new file mode 100644 (file)
index 0000000..4ad3c1e
--- /dev/null
@@ -0,0 +1,15 @@
+|a+0&#ffffff0|b|c|d|e| |a|b|c|d|e| |a|b|c|d|e| |a|b|c|d|e| |a
+|b|c|d|e| >a|b|c|d|e| |a|b|c|d|e| |a|b|c|d|e| |a|b
+|c|d|e| |a|b|c|d|e| |a|b|c|d|e| |a|b|c|d|e| |a|b|c
+|d|e| |a|b|c|d|e| |a|b|c|d|e| |a|b|c|d|e| |a|b|c|d
+|e| |a|b| +0#0000001#e0e0e08|f|o@1| @11| +0#0000000#ffffff0@4
+|~+0#4040ff13&| @2| +0#0000001#ffd7ff255|b|a|r| @11| +0#4040ff13#ffffff0@4
+|~| @2| +0#0000001#ffd7ff255|f|o@1|b|a|r| @8| +0#4040ff13#ffffff0@4
+|~| @23
+|~| @23
+|~| @23
+|~| @23
+|~| @23
+|~| @23
+|~| @23
+|-+2#0000000&@1| |m+0#00e0003&|a|t|c|h| |1| |o|f| |3| +0#0000000&@9
diff --git a/src/testdir/dumps/Test_pum_wrap_line3.dump b/src/testdir/dumps/Test_pum_wrap_line3.dump
new file mode 100644 (file)
index 0000000..ebfffc9
--- /dev/null
@@ -0,0 +1,15 @@
+|a+0&#ffffff0|b|c|d|e| |a|b|c|d|e| |a|b|c|d|e| |a|b|c|d|e| |a
+|b|c|d|e| |a|b|c|d|e| |a|b|c|d|e| |a|b|c|d|e| |a|b
+|c|d|e| |a>b|c|d|e| |a|b|c|d|e| |a|b|c|d|e| |a|b|c
+|d|e| |a|b|c|d|e| |a|b|c|d|e| |a|b|c|d|e| |a|b|c|d
+|e| |a|b|c|d|e| |a|b|c|d|e| |a|b|c|d|e| @5
+|~+0#4040ff13&| @2| +0#0000001#e0e0e08|f|o@1| @11| +0#4040ff13#ffffff0@4
+|~| @2| +0#0000001#ffd7ff255|b|a|r| @11| +0#4040ff13#ffffff0@4
+|~| @2| +0#0000001#ffd7ff255|f|o@1|b|a|r| @8| +0#4040ff13#ffffff0@4
+|~| @23
+|~| @23
+|~| @23
+|~| @23
+|~| @23
+|~| @23
+|-+2#0000000&@1| |m+0#00e0003&|a|t|c|h| |1| |o|f| |3| +0#0000000&@9
diff --git a/src/testdir/dumps/Test_pum_wrap_line4.dump b/src/testdir/dumps/Test_pum_wrap_line4.dump
new file mode 100644 (file)
index 0000000..dbec3dc
--- /dev/null
@@ -0,0 +1,15 @@
+|a+0&#ffffff0|b|c|d|e| |a|b|c|d|e| |a|b|c|d|e| |a|b|c|d|e| |a
+|b|c|d|e| |a|b|c|d|e| |a|b|c|d|e| |a|b|c|d|e| |a|b
+|c|d|e| |a|b|c|d|e| |a|b|c|d|e| |a|b|c|d|e| |a|b|c
+|d|e| |a|b|c|d|e| |a>b|c|d|e| |a|b|c|d|e| |a|b|c|d
+|e| |a|b|c|d|e| |a|b|c|d|e| |a|b|c|d|e| @5
+|~+0#4040ff13&| @7| +0#0000001#e0e0e08|f|o@1| @11
+|~+0#4040ff13#ffffff0| @7| +0#0000001#ffd7ff255|b|a|r| @11
+|~+0#4040ff13#ffffff0| @7| +0#0000001#ffd7ff255|f|o@1|b|a|r| @8
+|~+0#4040ff13#ffffff0| @23
+|~| @23
+|~| @23
+|~| @23
+|~| @23
+|~| @23
+|-+2#0000000&@1| |m+0#00e0003&|a|t|c|h| |1| |o|f| |3| +0#0000000&@9
diff --git a/src/testdir/dumps/Test_pum_wrap_line5.dump b/src/testdir/dumps/Test_pum_wrap_line5.dump
new file mode 100644 (file)
index 0000000..044bdb6
--- /dev/null
@@ -0,0 +1,15 @@
+|a+0&#ffffff0|b|c|d|e| |a|b|c|d|e| |a|b|c|d|e| |a|b|c|d|e| |a
+|b|c|d|e| |a|b|c|d|e| |a|b|c|d|e| |a|b|c|d|e| |a|b
+|c|d|e| |a|b|c|d|e| |a|b|c|d|e| |a|b|c|d|e| |a|b|c
+|d|e| |a|b|c|d|e| |a|b|c|d|e| |a|b|c|d|e| |a|b|c|d
+|e| |a|b|c|d|e| >a|b|c|d|e| |a|b|c|d|e| @5
+|~+0#4040ff13&| @5| +0#0000001#e0e0e08|f|o@1| @11| +0#4040ff13#ffffff0@1
+|~| @5| +0#0000001#ffd7ff255|b|a|r| @11| +0#4040ff13#ffffff0@1
+|~| @5| +0#0000001#ffd7ff255|f|o@1|b|a|r| @8| +0#4040ff13#ffffff0@1
+|~| @23
+|~| @23
+|~| @23
+|~| @23
+|~| @23
+|~| @23
+|-+2#0000000&@1| |m+0#00e0003&|a|t|c|h| |1| |o|f| |3| +0#0000000&@9
index 1fd18ca4ee334ce1d625eaf37dbff8e4b3541a81..0ace290d20db32c66eb62347f130846c3f4a14cb 100644 (file)
@@ -2215,5 +2215,70 @@ func Test_pum_clear_when_switch_tab_or_win()
   call StopVimInTerminal(buf)
 endfunc
 
+func Test_pum_position_when_wrap()
+  CheckScreendump
+  let lines =<< trim END
+    func Omni_test(findstart, base)
+      if a:findstart
+        return col(".")
+      endif
+      return ['foo', 'bar', 'foobar']
+    endfunc
+    set omnifunc=Omni_test
+    set wrap
+    set cot+=noinsert
+  END
+  call writefile(lines, 'Xtest', 'D')
+  let buf = RunVimInTerminal('-S Xtest', #{rows: 15, cols: 25})
+
+  let long_text = repeat('abcde ', 20)
+  call term_sendkeys(buf, "i" .. long_text)
+  call TermWait(buf, 50)
+  call term_sendkeys(buf, "\<ESC>")
+  call TermWait(buf, 50)
+
+  call term_sendkeys(buf, "5|")
+  call TermWait(buf, 50)
+  call term_sendkeys(buf, "a\<C-X>\<C-O>")
+  call TermWait(buf, 100)
+  call VerifyScreenDump(buf, 'Test_pum_wrap_line1', {})
+  call term_sendkeys(buf, "\<ESC>")
+  call TermWait(buf, 50)
+
+  call term_sendkeys(buf, "30|")
+  call TermWait(buf, 50)
+  call term_sendkeys(buf, "a\<C-X>\<C-O>")
+  call TermWait(buf, 100)
+  call VerifyScreenDump(buf, 'Test_pum_wrap_line2', {})
+  call term_sendkeys(buf, "\<ESC>")
+  call TermWait(buf, 50)
+
+  call term_sendkeys(buf, "55|")
+  call TermWait(buf, 50)
+  call term_sendkeys(buf, "a\<C-X>\<C-O>")
+  call TermWait(buf, 100)
+  call VerifyScreenDump(buf, 'Test_pum_wrap_line3', {})
+  call term_sendkeys(buf, "\<C-E>\<ESC>")
+  call TermWait(buf, 50)
+
+  call term_sendkeys(buf, "85|")
+  call TermWait(buf, 50)
+  call term_sendkeys(buf, "a\<C-X>\<C-O>")
+  call TermWait(buf, 100)
+  call VerifyScreenDump(buf, 'Test_pum_wrap_line4', {})
+  call term_sendkeys(buf, "\<C-E>\<ESC>")
+  call TermWait(buf, 100)
+
+  call term_sendkeys(buf, "108|")
+  call TermWait(buf, 50)
+  call term_sendkeys(buf, "a\<C-X>\<C-O>")
+  call TermWait(buf, 100)
+  call VerifyScreenDump(buf, 'Test_pum_wrap_line5', {})
+  call term_sendkeys(buf, "\<C-E>\<ESC>")
+  call TermWait(buf, 100)
+
+  call StopVimInTerminal(buf)
+endfunc
+
 
 " vim: shiftwidth=2 sts=2 expandtab
index 03922e5f212c8645ee341c7c508c81cb8d622078..5907766573cbf74427f67573f1a8e93305ec5aef 100644 (file)
@@ -709,6 +709,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1454,
 /**/
     1453,
 /**/