patch 9.1.1454: tests: no test for pum at line break position
Commit:
https://github.com/vim/vim/commit/6cc9bd400192470cd8521fdde6b3d8a0d2e43111
Author: glepnir <[email protected]>
Date: Wed Jun 11 21:14:02 2025 +0200
patch 9.1.1454: tests: no test for pum at line break position
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 <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/src/testdir/dumps/Test_pum_wrap_line1.dump
b/src/testdir/dumps/Test_pum_wrap_line1.dump
new file mode 100644
index 000000000..d4d3ea56d
--- /dev/null
+++ b/src/testdir/dumps/Test_pum_wrap_line1.dump
@@ -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
index 000000000..4ad3c1eac
--- /dev/null
+++ b/src/testdir/dumps/Test_pum_wrap_line2.dump
@@ -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
index 000000000..ebfffc9c6
--- /dev/null
+++ b/src/testdir/dumps/Test_pum_wrap_line3.dump
@@ -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
index 000000000..dbec3dcb5
--- /dev/null
+++ b/src/testdir/dumps/Test_pum_wrap_line4.dump
@@ -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
index 000000000..044bdb60d
--- /dev/null
+++ b/src/testdir/dumps/Test_pum_wrap_line5.dump
@@ -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
diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim
index 1fd18ca4e..0ace290d2 100644
--- a/src/testdir/test_popup.vim
+++ b/src/testdir/test_popup.vim
@@ -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
diff --git a/src/version.c b/src/version.c
index 03922e5f2..590776657 100644
--- a/src/version.c
+++ b/src/version.c
@@ -709,6 +709,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1454,
/**/
1453,
/**/
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/vim_dev/E1uPR9B-00Ds3s-Co%40256bit.org.