Skip to content

Commit ae0f30b

Browse files
committed
patch 8.1.0045: popup test isn't run completely
Problem: Popup test isn't run completely. Solution: Remove "finish". Clean up function definitions.
1 parent 8903676 commit ae0f30b

File tree

2 files changed

+27
-29
lines changed

2 files changed

+27
-29
lines changed

src/testdir/test_popup.vim

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ source screendump.vim
66
let g:months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
77
let g:setting = ''
88

9-
func! ListMonths()
9+
func ListMonths()
1010
if g:setting != ''
1111
exe ":set" g:setting
1212
endif
@@ -19,7 +19,7 @@ func! ListMonths()
1919
return ''
2020
endfunc
2121

22-
func! Test_popup_complete2()
22+
func Test_popup_complete2()
2323
" Although the popupmenu is not visible, this does not mean completion mode
2424
" has ended. After pressing <f5> to complete the currently typed char, Vim
2525
" still stays in the first state of the completion (:h ins-completion-menu),
@@ -34,9 +34,9 @@ func! Test_popup_complete2()
3434
call assert_equal(["Dece", "", "December2015"], getline(1,3))
3535
%d
3636
bw!
37-
endfu
37+
endfunc
3838

39-
func! Test_popup_complete()
39+
func Test_popup_complete()
4040
new
4141
inoremap <f5> <c-r>=ListMonths()<cr>
4242
@@ -215,10 +215,10 @@ func! Test_popup_complete()
215215
call feedkeys("aM\<f5>\<enter>\<esc>", 'tx')
216216
call assert_equal(["March", "M", "March"], getline(1,4))
217217
%d
218-
endfu
218+
endfunc
219219

220220

221-
func! Test_popup_completion_insertmode()
221+
func Test_popup_completion_insertmode()
222222
new
223223
inoremap <F5> <C-R>=ListMonths()<CR>
224224
@@ -247,20 +247,16 @@ func! Test_popup_completion_insertmode()
247247
iunmap <F5>
248248
endfunc
249249

250-
" TODO: Fix what breaks after this line.
251-
" - Do not use "q!", it may exit Vim if there is an error
252-
finish
253-
254250
func Test_noinsert_complete()
255-
function! s:complTest1() abort
251+
func! s:complTest1() abort
256252
call complete(1, ['source', 'soundfold'])
257253
return ''
258-
endfunction
254+
endfunc
259255

260-
function! s:complTest2() abort
256+
func! s:complTest2() abort
261257
call complete(1, ['source', 'soundfold'])
262258
return ''
263-
endfunction
259+
endfunc
264260

265261
new
266262
set completeopt+=noinsert
@@ -281,9 +277,9 @@ func Test_noinsert_complete()
281277
endfunc
282278

283279
func Test_compl_vim_cmds_after_register_expr()
284-
function! s:test_func()
280+
func! s:test_func()
285281
return 'autocmd '
286-
endfunction
282+
endfunc
287283
augroup AAAAA_Group
288284
au!
289285
augroup END
@@ -330,7 +326,7 @@ func DummyCompleteTwo(findstart, base)
330326
else
331327
return ['twodef', 'twoDEF']
332328
endif
333-
endfunction
329+
endfunc
334330

335331
" Test that nothing happens if the 'completefunc' opens
336332
" a new window (no completion, no crash)
@@ -407,7 +403,7 @@ func Test_omnifunc_with_check()
407403
q!
408404
endfunc
409405

410-
function UndoComplete()
406+
func UndoComplete()
411407
call complete(1, ['January', 'February', 'March',
412408
\ 'April', 'May', 'June', 'July', 'August', 'September',
413409
\ 'October', 'November', 'December'])
@@ -444,7 +440,7 @@ func Test_complete_no_undo()
444440
q!
445441
endfunc
446442

447-
function! DummyCompleteFive(findstart, base)
443+
func DummyCompleteFive(findstart, base)
448444
if a:findstart
449445
return 0
450446
else
@@ -489,7 +485,7 @@ func Test_completion_ctrl_e_without_autowrap()
489485
q!
490486
endfunc
491487

492-
function! DummyCompleteSix()
488+
func DummyCompleteSix()
493489
call complete(1, ['Hello', 'World'])
494490
return ''
495491
endfunction
@@ -577,22 +573,22 @@ func Test_completion_comment_formatting()
577573
bwipe!
578574
endfunc
579575

580-
fun MessCompleteMonths()
576+
func MessCompleteMonths()
581577
for m in split("Jan Feb Mar Apr May Jun Jul Aug Sep")
582578
call complete_add(m)
583579
if complete_check()
584580
break
585581
endif
586582
endfor
587583
return []
588-
endfun
584+
endfunc
589585

590-
fun MessCompleteMore()
586+
func MessCompleteMore()
591587
call complete(1, split("Oct Nov Dec"))
592588
return []
593-
endfun
589+
endfunc
594590

595-
fun MessComplete(findstart, base)
591+
func MessComplete(findstart, base)
596592
if a:findstart
597593
let line = getline('.')
598594
let start = col('.') - 1
@@ -605,7 +601,7 @@ fun MessComplete(findstart, base)
605601
call MessCompleteMore()
606602
return []
607603
endif
608-
endf
604+
endfunc
609605

610606
func Test_complete_func_mess()
611607
" Calling complete() after complete_add() in 'completefunc' is wrong, but it
@@ -835,15 +831,15 @@ func Test_popup_complete_backwards_ctrl_p()
835831
bwipe!
836832
endfunc
837833

838-
fun! Test_complete_o_tab()
834+
func Test_complete_o_tab()
839835
let s:o_char_pressed = 0
840836

841837
fun! s:act_on_text_changed()
842838
if s:o_char_pressed
843839
let s:o_char_pressed = 0
844840
call feedkeys("\<c-x>\<c-n>", 'i')
845841
endif
846-
endf
842+
endfunc
847843

848844
set completeopt=menu,noselect
849845
new
@@ -862,7 +858,7 @@ fun! Test_complete_o_tab()
862858
bwipe!
863859
set completeopt&
864860
delfunc s:act_on_text_changed
865-
endf
861+
endfunc
866862

867863

868864
" vim: shiftwidth=2 sts=2 expandtab

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,8 @@ static char *(features[]) =
761761

762762
static int included_patches[] =
763763
{ /* Add new patch number below this line */
764+
/**/
765+
45,
764766
/**/
765767
44,
766768
/**/

0 commit comments

Comments
 (0)