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 <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
glepnir
2025-06-11 21:14:02 +02:00
committed by Christian Brabandt
parent 5923216f79
commit 6cc9bd4001
7 changed files with 142 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View 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

View File

@ -709,6 +709,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1454,
/**/
1453,
/**/