mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.1.0045: popup test isn't run completely
Problem: Popup test isn't run completely.
Solution: Remove "finish". Clean up function definitions.
ae0f30b761
This commit is contained in:
parent
a8783012e4
commit
fb33bae02d
@ -5,7 +5,7 @@ source shared.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
|
||||||
@ -18,7 +18,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),
|
||||||
@ -33,9 +33,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>
|
||||||
|
|
||||||
@ -214,10 +214,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>
|
||||||
|
|
||||||
@ -246,20 +246,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
|
||||||
@ -280,9 +276,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
|
||||||
@ -329,7 +325,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)
|
||||||
@ -406,7 +402,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'])
|
||||||
@ -443,7 +439,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
|
||||||
@ -547,7 +543,7 @@ func Test_completion_comment_formatting()
|
|||||||
bwipe!
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
function! DummyCompleteSix()
|
func DummyCompleteSix()
|
||||||
call complete(1, ['Hello', 'World'])
|
call complete(1, ['Hello', 'World'])
|
||||||
return ''
|
return ''
|
||||||
endfunction
|
endfunction
|
||||||
@ -623,7 +619,7 @@ func Test_popup_and_preview_autocommand()
|
|||||||
bw!
|
bw!
|
||||||
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()
|
||||||
@ -631,14 +627,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
|
||||||
@ -651,7 +647,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
|
||||||
|
Loading…
Reference in New Issue
Block a user