vim-patch:8.0.1539: no test for the popup menu positioning

Problem:    No test for the popup menu positioning.
Solution:   Add a screendump test for the popup menu.
6bb2cdfe60
This commit is contained in:
Jan Edmund Lazo
2019-09-20 02:18:38 -04:00
parent b853b6e4ea
commit ca11662515
3 changed files with 36 additions and 2 deletions

View File

@@ -6657,7 +6657,7 @@ remote_expr({server}, {string} [, {idvar} [, {timeout}]])
between (not at the end), like with join(expr, "\n").
If {idvar} is present and not empty, it is taken as the name
of a variable and a {serverid} for later use with
remote_read() is stored there.
|remote_read()| is stored there.
If {timeout} is given the read times out after this many
seconds. Otherwise a timeout of 600 seconds is used.
See also |clientserver| |RemoteReply|.

View File

@@ -1,6 +1,7 @@
" Test for completion menu
source shared.vim
source screendump.vim
let g:months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
let g:setting = ''
@@ -735,6 +736,38 @@ func Test_popup_and_preview_autocommand()
bw!
endfunc
func Test_popup_position()
if !CanRunVimInTerminal()
return
endif
call writefile([
\ '123456789_123456789_123456789_a',
\ '123456789_123456789_123456789_b',
\ ' 123',
\ ], 'Xtest')
let buf = RunVimInTerminal('Xtest', {})
call term_sendkeys(buf, ":vsplit\<CR>")
" default pumwidth in left window: overlap in right window
call term_sendkeys(buf, "GA\<C-N>")
call VerifyScreenDump(buf, 'Test_popup_position_01', {'rows': 8})
call term_sendkeys(buf, "\<Esc>u")
" default pumwidth: fill until right of window
call term_sendkeys(buf, "\<C-W>l")
call term_sendkeys(buf, "GA\<C-N>")
call VerifyScreenDump(buf, 'Test_popup_position_02', {'rows': 8})
" larger pumwidth: used as minimum width
call term_sendkeys(buf, "\<Esc>u")
call term_sendkeys(buf, ":set pumwidth=30\<CR>")
call term_sendkeys(buf, "GA\<C-N>")
call VerifyScreenDump(buf, 'Test_popup_position_03', {'rows': 8})
call term_sendkeys(buf, "\<Esc>u")
call StopVimInTerminal(buf)
call delete('Xtest')
endfunc
func Test_popup_complete_backwards()
new

View File

@@ -1,6 +1,7 @@
" Test for syntax and syntax iskeyword option
source view_util.vim
source screendump.vim
func GetSyntaxItem(pat)
let c = ''
@@ -526,7 +527,7 @@ func Test_syntax_c()
let $COLORFGBG = '15;0'
let buf = RunVimInTerminal('Xtest.c', {})
call VerifyScreenDump(buf, 'Test_syntax_c_01')
call VerifyScreenDump(buf, 'Test_syntax_c_01', {})
call StopVimInTerminal(buf)
let $COLORFGBG = ''