vim-patch:8.2.4339: CTRL-A does not work properly with the cmdline popup menu

Problem:    CTRL-A does not work properly with the cmdline popup menu.
Solution:   Fix issues with CTRL-A.  Add more tests for the cmdline popup
            menu.  Remove TermWait() before VeriryScreenDump().  Refactor the
            cmdline popup code. (Yegappan Lakshmanan, closes vim/vim#9735)

560dff49c0

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
This commit is contained in:
zeertzjq
2023-08-21 15:38:19 +08:00
parent 00f92f086e
commit 02ca31979b
8 changed files with 0 additions and 39 deletions

View File

@@ -217,7 +217,6 @@ func Test_appendbufline_redraw()
END END
call writefile(lines, 'XscriptMatchCommon') call writefile(lines, 'XscriptMatchCommon')
let buf = RunVimInTerminal('-S XscriptMatchCommon', #{rows: 10}) let buf = RunVimInTerminal('-S XscriptMatchCommon', #{rows: 10})
call TermWait(buf)
call VerifyScreenDump(buf, 'Test_appendbufline_1', {}) call VerifyScreenDump(buf, 'Test_appendbufline_1', {})
call StopVimInTerminal(buf) call StopVimInTerminal(buf)

View File

@@ -136,41 +136,30 @@ func Test_cursorline_screenline()
call writefile(lines, filename) call writefile(lines, filename)
" basic test " basic test
let buf = RunVimInTerminal('-S '. filename, #{rows: 20}) let buf = RunVimInTerminal('-S '. filename, #{rows: 20})
call TermWait(buf)
call VerifyScreenDump(buf, 'Test_'. filename. '_1', {}) call VerifyScreenDump(buf, 'Test_'. filename. '_1', {})
call term_sendkeys(buf, "fagj") call term_sendkeys(buf, "fagj")
call TermWait(buf)
call VerifyScreenDump(buf, 'Test_'. filename. '_2', {}) call VerifyScreenDump(buf, 'Test_'. filename. '_2', {})
call term_sendkeys(buf, "gj") call term_sendkeys(buf, "gj")
call TermWait(buf)
call VerifyScreenDump(buf, 'Test_'. filename. '_3', {}) call VerifyScreenDump(buf, 'Test_'. filename. '_3', {})
call term_sendkeys(buf, "gj") call term_sendkeys(buf, "gj")
call TermWait(buf)
call VerifyScreenDump(buf, 'Test_'. filename. '_4', {}) call VerifyScreenDump(buf, 'Test_'. filename. '_4', {})
call term_sendkeys(buf, "gj") call term_sendkeys(buf, "gj")
call TermWait(buf)
call VerifyScreenDump(buf, 'Test_'. filename. '_5', {}) call VerifyScreenDump(buf, 'Test_'. filename. '_5', {})
call term_sendkeys(buf, "gj") call term_sendkeys(buf, "gj")
call TermWait(buf)
call VerifyScreenDump(buf, 'Test_'. filename. '_6', {}) call VerifyScreenDump(buf, 'Test_'. filename. '_6', {})
" test with set list and cursorlineopt containing number " test with set list and cursorlineopt containing number
call term_sendkeys(buf, "gg0") call term_sendkeys(buf, "gg0")
call term_sendkeys(buf, ":set list cursorlineopt+=number listchars=space:-\<cr>") call term_sendkeys(buf, ":set list cursorlineopt+=number listchars=space:-\<cr>")
call VerifyScreenDump(buf, 'Test_'. filename. '_7', {}) call VerifyScreenDump(buf, 'Test_'. filename. '_7', {})
call term_sendkeys(buf, "fagj") call term_sendkeys(buf, "fagj")
call TermWait(buf)
call VerifyScreenDump(buf, 'Test_'. filename. '_8', {}) call VerifyScreenDump(buf, 'Test_'. filename. '_8', {})
call term_sendkeys(buf, "gj") call term_sendkeys(buf, "gj")
call TermWait(buf)
call VerifyScreenDump(buf, 'Test_'. filename. '_9', {}) call VerifyScreenDump(buf, 'Test_'. filename. '_9', {})
call term_sendkeys(buf, "gj") call term_sendkeys(buf, "gj")
call TermWait(buf)
call VerifyScreenDump(buf, 'Test_'. filename. '_10', {}) call VerifyScreenDump(buf, 'Test_'. filename. '_10', {})
call term_sendkeys(buf, "gj") call term_sendkeys(buf, "gj")
call TermWait(buf)
call VerifyScreenDump(buf, 'Test_'. filename. '_11', {}) call VerifyScreenDump(buf, 'Test_'. filename. '_11', {})
call term_sendkeys(buf, "gj") call term_sendkeys(buf, "gj")
call TermWait(buf)
call VerifyScreenDump(buf, 'Test_'. filename. '_12', {}) call VerifyScreenDump(buf, 'Test_'. filename. '_12', {})
if exists("+foldcolumn") && exists("+signcolumn") && exists("+breakindent") if exists("+foldcolumn") && exists("+signcolumn") && exists("+breakindent")
" test with set foldcolumn signcoloumn and breakindent " test with set foldcolumn signcoloumn and breakindent
@@ -178,19 +167,14 @@ func Test_cursorline_screenline()
call term_sendkeys(buf, ":set breakindent foldcolumn=2 signcolumn=yes\<cr>") call term_sendkeys(buf, ":set breakindent foldcolumn=2 signcolumn=yes\<cr>")
call VerifyScreenDump(buf, 'Test_'. filename. '_13', {}) call VerifyScreenDump(buf, 'Test_'. filename. '_13', {})
call term_sendkeys(buf, "fagj") call term_sendkeys(buf, "fagj")
call TermWait(buf)
call VerifyScreenDump(buf, 'Test_'. filename. '_14', {}) call VerifyScreenDump(buf, 'Test_'. filename. '_14', {})
call term_sendkeys(buf, "gj") call term_sendkeys(buf, "gj")
call TermWait(buf)
call VerifyScreenDump(buf, 'Test_'. filename. '_15', {}) call VerifyScreenDump(buf, 'Test_'. filename. '_15', {})
call term_sendkeys(buf, "gj") call term_sendkeys(buf, "gj")
call TermWait(buf)
call VerifyScreenDump(buf, 'Test_'. filename. '_16', {}) call VerifyScreenDump(buf, 'Test_'. filename. '_16', {})
call term_sendkeys(buf, "gj") call term_sendkeys(buf, "gj")
call TermWait(buf)
call VerifyScreenDump(buf, 'Test_'. filename. '_17', {}) call VerifyScreenDump(buf, 'Test_'. filename. '_17', {})
call term_sendkeys(buf, "gj") call term_sendkeys(buf, "gj")
call TermWait(buf)
call VerifyScreenDump(buf, 'Test_'. filename. '_18', {}) call VerifyScreenDump(buf, 'Test_'. filename. '_18', {})
call term_sendkeys(buf, ":set breakindent& foldcolumn& signcolumn&\<cr>") call term_sendkeys(buf, ":set breakindent& foldcolumn& signcolumn&\<cr>")
endif endif
@@ -200,19 +184,14 @@ func Test_cursorline_screenline()
call term_sendkeys(buf, ":set nonumber\<cr>") call term_sendkeys(buf, ":set nonumber\<cr>")
call VerifyScreenDump(buf, 'Test_'. filename. '_19', {}) call VerifyScreenDump(buf, 'Test_'. filename. '_19', {})
call term_sendkeys(buf, "fagj") call term_sendkeys(buf, "fagj")
call term_wait(buf)
call VerifyScreenDump(buf, 'Test_'. filename. '_20', {}) call VerifyScreenDump(buf, 'Test_'. filename. '_20', {})
call term_sendkeys(buf, "gj") call term_sendkeys(buf, "gj")
call term_wait(buf)
call VerifyScreenDump(buf, 'Test_'. filename. '_21', {}) call VerifyScreenDump(buf, 'Test_'. filename. '_21', {})
call term_sendkeys(buf, "gj") call term_sendkeys(buf, "gj")
call term_wait(buf)
call VerifyScreenDump(buf, 'Test_'. filename. '_22', {}) call VerifyScreenDump(buf, 'Test_'. filename. '_22', {})
call term_sendkeys(buf, "gj") call term_sendkeys(buf, "gj")
call term_wait(buf)
call VerifyScreenDump(buf, 'Test_'. filename. '_23', {}) call VerifyScreenDump(buf, 'Test_'. filename. '_23', {})
call term_sendkeys(buf, "gj") call term_sendkeys(buf, "gj")
call term_wait(buf)
call VerifyScreenDump(buf, 'Test_'. filename. '_24', {}) call VerifyScreenDump(buf, 'Test_'. filename. '_24', {})
call term_sendkeys(buf, ":set list& cursorlineopt& listchars&\<cr>") call term_sendkeys(buf, ":set list& cursorlineopt& listchars&\<cr>")

View File

@@ -852,7 +852,6 @@ func VerifyInternal(buf, dumpfile, extra)
call term_sendkeys(a:buf, ":diffupdate!\<CR>") call term_sendkeys(a:buf, ":diffupdate!\<CR>")
" trailing : for leaving the cursor on the command line " trailing : for leaving the cursor on the command line
call term_sendkeys(a:buf, ":set diffopt=internal,filler" . a:extra . "\<CR>:") call term_sendkeys(a:buf, ":set diffopt=internal,filler" . a:extra . "\<CR>:")
call TermWait(a:buf)
call VerifyScreenDump(a:buf, a:dumpfile, {}) call VerifyScreenDump(a:buf, a:dumpfile, {})
endfunc endfunc

View File

@@ -177,7 +177,6 @@ func Test_scroll_CursorLineNr_update()
call writefile(lines, filename) call writefile(lines, filename)
let buf = RunVimInTerminal('-S '.filename, #{rows: 5, cols: 50}) let buf = RunVimInTerminal('-S '.filename, #{rows: 5, cols: 50})
call term_sendkeys(buf, "k") call term_sendkeys(buf, "k")
call TermWait(buf)
call VerifyScreenDump(buf, 'Test_winline_rnu', {}) call VerifyScreenDump(buf, 'Test_winline_rnu', {})
" clean up " clean up

View File

@@ -718,7 +718,6 @@ func Test_colorcolumn()
call writefile(lines, 'Xtest_colorcolumn') call writefile(lines, 'Xtest_colorcolumn')
let buf = RunVimInTerminal('-S Xtest_colorcolumn', {'rows': 10}) let buf = RunVimInTerminal('-S Xtest_colorcolumn', {'rows': 10})
call term_sendkeys(buf, ":\<CR>") call term_sendkeys(buf, ":\<CR>")
call TermWait(buf)
call VerifyScreenDump(buf, 'Test_colorcolumn_1', {}) call VerifyScreenDump(buf, 'Test_colorcolumn_1', {})
" clean up " clean up
@@ -736,7 +735,6 @@ func Test_colorcolumn_bri()
call writefile(lines, 'Xtest_colorcolumn_bri') call writefile(lines, 'Xtest_colorcolumn_bri')
let buf = RunVimInTerminal('-S Xtest_colorcolumn_bri', {'rows': 10,'columns': 40}) let buf = RunVimInTerminal('-S Xtest_colorcolumn_bri', {'rows': 10,'columns': 40})
call term_sendkeys(buf, ":set co=40 linebreak bri briopt=shift:2 cc=40,41,43\<CR>") call term_sendkeys(buf, ":set co=40 linebreak bri briopt=shift:2 cc=40,41,43\<CR>")
call TermWait(buf)
call VerifyScreenDump(buf, 'Test_colorcolumn_2', {}) call VerifyScreenDump(buf, 'Test_colorcolumn_2', {})
" clean up " clean up

View File

@@ -373,7 +373,6 @@ func Test_match_in_linebreak()
END END
call writefile(lines, 'XscriptMatchLinebreak') call writefile(lines, 'XscriptMatchLinebreak')
let buf = RunVimInTerminal('-S XscriptMatchLinebreak', #{rows: 10}) let buf = RunVimInTerminal('-S XscriptMatchLinebreak', #{rows: 10})
call TermWait(buf)
call VerifyScreenDump(buf, 'Test_match_linebreak', {}) call VerifyScreenDump(buf, 'Test_match_linebreak', {})
call StopVimInTerminal(buf) call StopVimInTerminal(buf)
@@ -390,7 +389,6 @@ func Test_match_with_incsearch()
END END
call writefile(lines, 'XmatchWithIncsearch') call writefile(lines, 'XmatchWithIncsearch')
let buf = RunVimInTerminal('-S XmatchWithIncsearch', #{rows: 6}) let buf = RunVimInTerminal('-S XmatchWithIncsearch', #{rows: 6})
call TermWait(buf)
call VerifyScreenDump(buf, 'Test_match_with_incsearch_1', {}) call VerifyScreenDump(buf, 'Test_match_with_incsearch_1', {})
call term_sendkeys(buf, ":s/0") call term_sendkeys(buf, ":s/0")
@@ -431,7 +429,6 @@ func Test_match_tab_with_linebreak()
END END
call writefile(lines, 'XscriptMatchTabLinebreak') call writefile(lines, 'XscriptMatchTabLinebreak')
let buf = RunVimInTerminal('-S XscriptMatchTabLinebreak', #{rows: 10}) let buf = RunVimInTerminal('-S XscriptMatchTabLinebreak', #{rows: 10})
call TermWait(buf)
call VerifyScreenDump(buf, 'Test_match_tab_linebreak', {}) call VerifyScreenDump(buf, 'Test_match_tab_linebreak', {})
call StopVimInTerminal(buf) call StopVimInTerminal(buf)

View File

@@ -1210,7 +1210,6 @@ func Test_pum_rightleft()
let buf = RunVimInTerminal('--cmd "set rightleft" Xtest1', {}) let buf = RunVimInTerminal('--cmd "set rightleft" Xtest1', {})
call term_wait(buf) call term_wait(buf)
call term_sendkeys(buf, "Go\<C-P>") call term_sendkeys(buf, "Go\<C-P>")
call term_wait(buf)
call VerifyScreenDump(buf, 'Test_pum_rightleft_01', {'rows': 8}) call VerifyScreenDump(buf, 'Test_pum_rightleft_01', {'rows': 8})
call term_sendkeys(buf, "\<C-P>\<C-Y>") call term_sendkeys(buf, "\<C-P>\<C-Y>")
call term_wait(buf) call term_wait(buf)
@@ -1252,7 +1251,6 @@ func Test_pum_scrollbar()
let buf = RunVimInTerminal('--cmd "set pumheight=2" Xtest1', {}) let buf = RunVimInTerminal('--cmd "set pumheight=2" Xtest1', {})
call term_wait(buf) call term_wait(buf)
call term_sendkeys(buf, "Go\<C-P>\<C-P>\<C-P>") call term_sendkeys(buf, "Go\<C-P>\<C-P>\<C-P>")
call term_wait(buf)
call VerifyScreenDump(buf, 'Test_pum_scrollbar_01', {'rows': 7}) call VerifyScreenDump(buf, 'Test_pum_scrollbar_01', {'rows': 7})
call term_sendkeys(buf, "\<C-E>\<Esc>dd") call term_sendkeys(buf, "\<C-E>\<Esc>dd")
call term_wait(buf) call term_wait(buf)
@@ -1261,7 +1259,6 @@ func Test_pum_scrollbar()
call term_sendkeys(buf, ":set rightleft\<CR>") call term_sendkeys(buf, ":set rightleft\<CR>")
call term_wait(buf) call term_wait(buf)
call term_sendkeys(buf, "Go\<C-P>\<C-P>\<C-P>") call term_sendkeys(buf, "Go\<C-P>\<C-P>\<C-P>")
call term_wait(buf)
call VerifyScreenDump(buf, 'Test_pum_scrollbar_02', {'rows': 7}) call VerifyScreenDump(buf, 'Test_pum_scrollbar_02', {'rows': 7})
endif endif

View File

@@ -333,15 +333,12 @@ func Test_search_stat_foldopen()
call writefile(lines, 'Xsearchstat1') call writefile(lines, 'Xsearchstat1')
let buf = RunVimInTerminal('-S Xsearchstat1', #{rows: 10}) let buf = RunVimInTerminal('-S Xsearchstat1', #{rows: 10})
call TermWait(buf)
call VerifyScreenDump(buf, 'Test_searchstat_3', {}) call VerifyScreenDump(buf, 'Test_searchstat_3', {})
call term_sendkeys(buf, "n") call term_sendkeys(buf, "n")
call TermWait(buf)
call VerifyScreenDump(buf, 'Test_searchstat_3', {}) call VerifyScreenDump(buf, 'Test_searchstat_3', {})
call term_sendkeys(buf, "n") call term_sendkeys(buf, "n")
call TermWait(buf)
call VerifyScreenDump(buf, 'Test_searchstat_3', {}) call VerifyScreenDump(buf, 'Test_searchstat_3', {})
call StopVimInTerminal(buf) call StopVimInTerminal(buf)
@@ -364,12 +361,10 @@ func! Test_search_stat_screendump()
END END
call writefile(lines, 'Xsearchstat') call writefile(lines, 'Xsearchstat')
let buf = RunVimInTerminal('-S Xsearchstat', #{rows: 10}) let buf = RunVimInTerminal('-S Xsearchstat', #{rows: 10})
call TermWait(buf)
call VerifyScreenDump(buf, 'Test_searchstat_1', {}) call VerifyScreenDump(buf, 'Test_searchstat_1', {})
call term_sendkeys(buf, ":nnoremap <silent> n n\<cr>") call term_sendkeys(buf, ":nnoremap <silent> n n\<cr>")
call term_sendkeys(buf, "gg0n") call term_sendkeys(buf, "gg0n")
call TermWait(buf)
call VerifyScreenDump(buf, 'Test_searchstat_2', {}) call VerifyScreenDump(buf, 'Test_searchstat_2', {})
call StopVimInTerminal(buf) call StopVimInTerminal(buf)
@@ -388,11 +383,9 @@ func Test_search_stat_then_gd()
let buf = RunVimInTerminal('-S Xsearchstatgd', #{rows: 10}) let buf = RunVimInTerminal('-S Xsearchstatgd', #{rows: 10})
call term_sendkeys(buf, "/dog\<CR>") call term_sendkeys(buf, "/dog\<CR>")
call TermWait(buf)
call VerifyScreenDump(buf, 'Test_searchstatgd_1', {}) call VerifyScreenDump(buf, 'Test_searchstatgd_1', {})
call term_sendkeys(buf, "G0gD") call term_sendkeys(buf, "G0gD")
call TermWait(buf)
call VerifyScreenDump(buf, 'Test_searchstatgd_2', {}) call VerifyScreenDump(buf, 'Test_searchstatgd_2', {})
call StopVimInTerminal(buf) call StopVimInTerminal(buf)