0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

patch 8.1.0045: popup test isn't run completely

Problem:    Popup test isn't run completely.
Solution:   Remove "finish".  Clean up function definitions.
This commit is contained in:
Bram Moolenaar
2018-06-12 15:22:43 +02:00
parent 8903676d3d
commit ae0f30b761
2 changed files with 27 additions and 29 deletions

View File

@@ -6,7 +6,7 @@ source screendump.vim
let g:months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] let g:months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
let g:setting = '' let g:setting = ''
func! ListMonths() func ListMonths()
if g:setting != '' if g:setting != ''
exe ":set" g:setting exe ":set" g:setting
endif endif
@@ -19,7 +19,7 @@ func! ListMonths()
return '' return ''
endfunc endfunc
func! Test_popup_complete2() func Test_popup_complete2()
" Although the popupmenu is not visible, this does not mean completion mode " Although the popupmenu is not visible, this does not mean completion mode
" has ended. After pressing <f5> to complete the currently typed char, Vim " has ended. After pressing <f5> to complete the currently typed char, Vim
" still stays in the first state of the completion (:h ins-completion-menu), " still stays in the first state of the completion (:h ins-completion-menu),
@@ -34,9 +34,9 @@ func! Test_popup_complete2()
call assert_equal(["Dece", "", "December2015"], getline(1,3)) call assert_equal(["Dece", "", "December2015"], getline(1,3))
%d %d
bw! bw!
endfu endfunc
func! Test_popup_complete() func Test_popup_complete()
new new
inoremap <f5> <c-r>=ListMonths()<cr> inoremap <f5> <c-r>=ListMonths()<cr>
@@ -215,10 +215,10 @@ func! Test_popup_complete()
call feedkeys("aM\<f5>\<enter>\<esc>", 'tx') call feedkeys("aM\<f5>\<enter>\<esc>", 'tx')
call assert_equal(["March", "M", "March"], getline(1,4)) call assert_equal(["March", "M", "March"], getline(1,4))
%d %d
endfu endfunc
func! Test_popup_completion_insertmode() func Test_popup_completion_insertmode()
new new
inoremap <F5> <C-R>=ListMonths()<CR> inoremap <F5> <C-R>=ListMonths()<CR>
@@ -247,20 +247,16 @@ func! Test_popup_completion_insertmode()
iunmap <F5> iunmap <F5>
endfunc endfunc
" TODO: Fix what breaks after this line.
" - Do not use "q!", it may exit Vim if there is an error
finish
func Test_noinsert_complete() func Test_noinsert_complete()
function! s:complTest1() abort func! s:complTest1() abort
call complete(1, ['source', 'soundfold']) call complete(1, ['source', 'soundfold'])
return '' return ''
endfunction endfunc
function! s:complTest2() abort func! s:complTest2() abort
call complete(1, ['source', 'soundfold']) call complete(1, ['source', 'soundfold'])
return '' return ''
endfunction endfunc
new new
set completeopt+=noinsert set completeopt+=noinsert
@@ -281,9 +277,9 @@ func Test_noinsert_complete()
endfunc endfunc
func Test_compl_vim_cmds_after_register_expr() func Test_compl_vim_cmds_after_register_expr()
function! s:test_func() func! s:test_func()
return 'autocmd ' return 'autocmd '
endfunction endfunc
augroup AAAAA_Group augroup AAAAA_Group
au! au!
augroup END augroup END
@@ -330,7 +326,7 @@ func DummyCompleteTwo(findstart, base)
else else
return ['twodef', 'twoDEF'] return ['twodef', 'twoDEF']
endif endif
endfunction endfunc
" Test that nothing happens if the 'completefunc' opens " Test that nothing happens if the 'completefunc' opens
" a new window (no completion, no crash) " a new window (no completion, no crash)
@@ -407,7 +403,7 @@ func Test_omnifunc_with_check()
q! q!
endfunc endfunc
function UndoComplete() func UndoComplete()
call complete(1, ['January', 'February', 'March', call complete(1, ['January', 'February', 'March',
\ 'April', 'May', 'June', 'July', 'August', 'September', \ 'April', 'May', 'June', 'July', 'August', 'September',
\ 'October', 'November', 'December']) \ 'October', 'November', 'December'])
@@ -444,7 +440,7 @@ func Test_complete_no_undo()
q! q!
endfunc endfunc
function! DummyCompleteFive(findstart, base) func DummyCompleteFive(findstart, base)
if a:findstart if a:findstart
return 0 return 0
else else
@@ -489,7 +485,7 @@ func Test_completion_ctrl_e_without_autowrap()
q! q!
endfunc endfunc
function! DummyCompleteSix() func DummyCompleteSix()
call complete(1, ['Hello', 'World']) call complete(1, ['Hello', 'World'])
return '' return ''
endfunction endfunction
@@ -577,7 +573,7 @@ func Test_completion_comment_formatting()
bwipe! bwipe!
endfunc endfunc
fun MessCompleteMonths() func MessCompleteMonths()
for m in split("Jan Feb Mar Apr May Jun Jul Aug Sep") for m in split("Jan Feb Mar Apr May Jun Jul Aug Sep")
call complete_add(m) call complete_add(m)
if complete_check() if complete_check()
@@ -585,14 +581,14 @@ fun MessCompleteMonths()
endif endif
endfor endfor
return [] return []
endfun endfunc
fun MessCompleteMore() func MessCompleteMore()
call complete(1, split("Oct Nov Dec")) call complete(1, split("Oct Nov Dec"))
return [] return []
endfun endfunc
fun MessComplete(findstart, base) func MessComplete(findstart, base)
if a:findstart if a:findstart
let line = getline('.') let line = getline('.')
let start = col('.') - 1 let start = col('.') - 1
@@ -605,7 +601,7 @@ fun MessComplete(findstart, base)
call MessCompleteMore() call MessCompleteMore()
return [] return []
endif endif
endf endfunc
func Test_complete_func_mess() func Test_complete_func_mess()
" Calling complete() after complete_add() in 'completefunc' is wrong, but it " Calling complete() after complete_add() in 'completefunc' is wrong, but it
@@ -835,7 +831,7 @@ func Test_popup_complete_backwards_ctrl_p()
bwipe! bwipe!
endfunc endfunc
fun! Test_complete_o_tab() func Test_complete_o_tab()
let s:o_char_pressed = 0 let s:o_char_pressed = 0
fun! s:act_on_text_changed() fun! s:act_on_text_changed()
@@ -843,7 +839,7 @@ fun! Test_complete_o_tab()
let s:o_char_pressed = 0 let s:o_char_pressed = 0
call feedkeys("\<c-x>\<c-n>", 'i') call feedkeys("\<c-x>\<c-n>", 'i')
endif endif
endf endfunc
set completeopt=menu,noselect set completeopt=menu,noselect
new new
@@ -862,7 +858,7 @@ fun! Test_complete_o_tab()
bwipe! bwipe!
set completeopt& set completeopt&
delfunc s:act_on_text_changed delfunc s:act_on_text_changed
endf endfunc
" vim: shiftwidth=2 sts=2 expandtab " vim: shiftwidth=2 sts=2 expandtab

View File

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