let g:months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
let g:setting = ''
-func! ListMonths()
+func ListMonths()
if g:setting != ''
exe ":set" g:setting
endif
return ''
endfunc
-func! Test_popup_complete2()
+func Test_popup_complete2()
" Although the popupmenu is not visible, this does not mean completion mode
" 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),
call assert_equal(["Dece", "", "December2015"], getline(1,3))
%d
bw!
-endfu
+endfunc
-func! Test_popup_complete()
+func Test_popup_complete()
new
inoremap <f5> <c-r>=ListMonths()<cr>
call feedkeys("aM\<f5>\<enter>\<esc>", 'tx')
call assert_equal(["March", "M", "March"], getline(1,4))
%d
-endfu
+endfunc
-func! Test_popup_completion_insertmode()
+func Test_popup_completion_insertmode()
new
inoremap <F5> <C-R>=ListMonths()<CR>
iunmap <F5>
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()
- function! s:complTest1() abort
+ func! s:complTest1() abort
call complete(1, ['source', 'soundfold'])
return ''
- endfunction
+ endfunc
- function! s:complTest2() abort
+ func! s:complTest2() abort
call complete(1, ['source', 'soundfold'])
return ''
- endfunction
+ endfunc
new
set completeopt+=noinsert
endfunc
func Test_compl_vim_cmds_after_register_expr()
- function! s:test_func()
+ func! s:test_func()
return 'autocmd '
- endfunction
+ endfunc
augroup AAAAA_Group
au!
augroup END
else
return ['twodef', 'twoDEF']
endif
-endfunction
+endfunc
" Test that nothing happens if the 'completefunc' opens
" a new window (no completion, no crash)
q!
endfunc
-function UndoComplete()
+func UndoComplete()
call complete(1, ['January', 'February', 'March',
\ 'April', 'May', 'June', 'July', 'August', 'September',
\ 'October', 'November', 'December'])
q!
endfunc
-function! DummyCompleteFive(findstart, base)
+func DummyCompleteFive(findstart, base)
if a:findstart
return 0
else
q!
endfunc
-function! DummyCompleteSix()
+func DummyCompleteSix()
call complete(1, ['Hello', 'World'])
return ''
endfunction
bwipe!
endfunc
-fun MessCompleteMonths()
+func MessCompleteMonths()
for m in split("Jan Feb Mar Apr May Jun Jul Aug Sep")
call complete_add(m)
if complete_check()
endif
endfor
return []
-endfun
+endfunc
-fun MessCompleteMore()
+func MessCompleteMore()
call complete(1, split("Oct Nov Dec"))
return []
-endfun
+endfunc
-fun MessComplete(findstart, base)
+func MessComplete(findstart, base)
if a:findstart
let line = getline('.')
let start = col('.') - 1
call MessCompleteMore()
return []
endif
-endf
+endfunc
func Test_complete_func_mess()
" Calling complete() after complete_add() in 'completefunc' is wrong, but it
bwipe!
endfunc
-fun! Test_complete_o_tab()
+func Test_complete_o_tab()
let s:o_char_pressed = 0
fun! s:act_on_text_changed()
let s:o_char_pressed = 0
call feedkeys("\<c-x>\<c-n>", 'i')
endif
- endf
+ endfunc
set completeopt=menu,noselect
new
bwipe!
set completeopt&
delfunc s:act_on_text_changed
-endf
+endfunc
" vim: shiftwidth=2 sts=2 expandtab