mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-09 10:00:04 +08:00
test(flygrep): add test for flygrep
This commit is contained in:
parent
ae6ecf01cf
commit
ce699e7af7
@ -199,6 +199,10 @@ endfunction
|
|||||||
if has('nvim')
|
if has('nvim')
|
||||||
function! s:self.getchar(...) abort
|
function! s:self.getchar(...) abort
|
||||||
if !empty(get(g:, '_spacevim_input_list', []))
|
if !empty(get(g:, '_spacevim_input_list', []))
|
||||||
|
let input_timeout = get(g:, '_spacevim_input_timeout', 0)
|
||||||
|
if input_timeout > 0
|
||||||
|
exe printf('sleep %dm', input_timeout)
|
||||||
|
endif
|
||||||
return remove(g:_spacevim_input_list, 0)
|
return remove(g:_spacevim_input_list, 0)
|
||||||
endif
|
endif
|
||||||
try
|
try
|
||||||
@ -211,6 +215,10 @@ if has('nvim')
|
|||||||
else
|
else
|
||||||
function! s:self.getchar(...) abort
|
function! s:self.getchar(...) abort
|
||||||
if !empty(get(g:, '_spacevim_input_list', []))
|
if !empty(get(g:, '_spacevim_input_list', []))
|
||||||
|
let input_timeout = get(g:, '_spacevim_input_timeout', 0)
|
||||||
|
if input_timeout > 0
|
||||||
|
exe printf('sleep %dm', input_timeout)
|
||||||
|
endif
|
||||||
return remove(g:_spacevim_input_list, 0)
|
return remove(g:_spacevim_input_list, 0)
|
||||||
endif
|
endif
|
||||||
try
|
try
|
||||||
|
17
test/plugin/flygrep.vader
Normal file
17
test/plugin/flygrep.vader
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
Execute ( SpaceVim plugin: flygrep ):
|
||||||
|
edit Makefile
|
||||||
|
let g:_spacevim_input_list = ["\<C-u>", 'C', 'O', 'V', 'I', 'M', 'E', 'R', 'A', 'G', 'E', "\<Enter>"]
|
||||||
|
let g:_spacevim_input_timeout = 400
|
||||||
|
exe 'call SpaceVim#plugins#flygrep#open('
|
||||||
|
\ . '{"input" : expand("<cword>"), "files": bufname("%")}'
|
||||||
|
\ . ')'
|
||||||
|
let g:_spacevim_input_timeout = 0
|
||||||
|
let lnr = 0
|
||||||
|
for line in readfile('Makefile')
|
||||||
|
let lnr += 1
|
||||||
|
if line =~# 'COVIMERAGE'
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
AssertEqual lnr, 4
|
||||||
|
unlet lnr line
|
Loading…
Reference in New Issue
Block a user