mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-24 05:20:04 +08:00
Fix grep
This commit is contained in:
parent
c8ad3aca82
commit
25d2c516b4
@ -176,6 +176,8 @@ function! s:self.stop(id) abort
|
||||
if has_key(self.jobs, a:id)
|
||||
call job_stop(get(self.jobs, a:id))
|
||||
call remove(self.jobs, a:id)
|
||||
else
|
||||
call self.warn('No job with such id')
|
||||
endif
|
||||
else
|
||||
call self.warn()
|
||||
|
@ -201,10 +201,12 @@ endfunction
|
||||
function! s:grep_stdout(id, data, event) abort
|
||||
let datas =filter(a:data, '!empty(v:val)')
|
||||
let datas = s:LIST.uniq_by_func(datas, function('s:file_line'))
|
||||
if getline(1) ==# ''
|
||||
call setline(1, datas)
|
||||
else
|
||||
call append('$', datas)
|
||||
if bufnr('%') == s:flygrep_buffer_id
|
||||
if getline(1) ==# ''
|
||||
call setline(1, datas)
|
||||
else
|
||||
call append('$', datas)
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
@ -370,6 +372,7 @@ function! SpaceVim#plugins#flygrep#open(agrv) abort
|
||||
" set default handle func: s:flygrep
|
||||
let s:MPT._handle_fly = function('s:flygrep')
|
||||
rightbelow split __flygrep__
|
||||
let s:flygrep_buffer_id = bufnr('%')
|
||||
setlocal buftype=nofile bufhidden=wipe nobuflisted nolist noswapfile nowrap cursorline nospell nonu norelativenumber
|
||||
let save_tve = &t_ve
|
||||
setlocal t_ve=
|
||||
|
Loading…
Reference in New Issue
Block a user