|
@@ -6,7 +6,7 @@ source screendump.vim |
|
|
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 |
|
@@ -19,7 +19,7 @@ func! ListMonths() |
|
|
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), |
|
@@ -34,9 +34,9 @@ func! Test_popup_complete2() |
|
|
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> |
|
|
|
|
@@ -215,10 +215,10 @@ func! Test_popup_complete() |
|
|
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> |
|
|
|
|
@@ -247,20 +247,16 @@ func! Test_popup_completion_insertmode() |
|
|
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 |
|
@@ -281,9 +277,9 @@ func Test_noinsert_complete() |
|
|
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 |
|
@@ -330,7 +326,7 @@ func DummyCompleteTwo(findstart, base) |
|
|
else |
|
|
return ['twodef', 'twoDEF'] |
|
|
endif |
|
|
endfunction |
|
|
endfunc |
|
|
|
|
|
" Test that nothing happens if the 'completefunc' opens |
|
|
" a new window (no completion, no crash) |
|
@@ -407,7 +403,7 @@ func Test_omnifunc_with_check() |
|
|
q! |
|
|
endfunc |
|
|
|
|
|
function UndoComplete() |
|
|
func UndoComplete() |
|
|
call complete(1, ['January', 'February', 'March', |
|
|
\ 'April', 'May', 'June', 'July', 'August', 'September', |
|
|
\ 'October', 'November', 'December']) |
|
@@ -444,7 +440,7 @@ func Test_complete_no_undo() |
|
|
q! |
|
|
endfunc |
|
|
|
|
|
function! DummyCompleteFive(findstart, base) |
|
|
func DummyCompleteFive(findstart, base) |
|
|
if a:findstart |
|
|
return 0 |
|
|
else |
|
@@ -489,7 +485,7 @@ func Test_completion_ctrl_e_without_autowrap() |
|
|
q! |
|
|
endfunc |
|
|
|
|
|
function! DummyCompleteSix() |
|
|
func DummyCompleteSix() |
|
|
call complete(1, ['Hello', 'World']) |
|
|
return '' |
|
|
endfunction |
|
@@ -577,22 +573,22 @@ func Test_completion_comment_formatting() |
|
|
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() |
|
|
break |
|
|
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 |
|
@@ -605,7 +601,7 @@ fun MessComplete(findstart, base) |
|
|
call MessCompleteMore() |
|
|
return [] |
|
|
endif |
|
|
endf |
|
|
endfunc |
|
|
|
|
|
func Test_complete_func_mess() |
|
|
" Calling complete() after complete_add() in 'completefunc' is wrong, but it |
|
@@ -835,15 +831,15 @@ func Test_popup_complete_backwards_ctrl_p() |
|
|
bwipe! |
|
|
endfunc |
|
|
|
|
|
fun! Test_complete_o_tab() |
|
|
func Test_complete_o_tab() |
|
|
let s:o_char_pressed = 0 |
|
|
|
|
|
fun! s:act_on_text_changed() |
|
|
if s:o_char_pressed |
|
|
let s:o_char_pressed = 0 |
|
|
call feedkeys("\<c-x>\<c-n>", 'i') |
|
|
endif |
|
|
endf |
|
|
endfunc |
|
|
|
|
|
set completeopt=menu,noselect |
|
|
new |
|
@@ -862,7 +858,7 @@ fun! Test_complete_o_tab() |
|
|
bwipe! |
|
|
set completeopt& |
|
|
delfunc s:act_on_text_changed |
|
|
endf |
|
|
endfunc |
|
|
|
|
|
|
|
|
" vim: shiftwidth=2 sts=2 expandtab |