1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-24 09:30:04 +08:00

Merge pull request #1583 from wsdjeg/flygrep

Improve flygrep
This commit is contained in:
Wang Shidong 2018-03-31 21:17:19 +08:00 committed by GitHub
commit 96b4830ff1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 5 deletions

View File

@ -455,7 +455,6 @@ let g:spacevim_enable_vimfiler_gitstatus = 0
let g:spacevim_enable_vimfiler_filetypeicon = 0
let g:spacevim_smartcloseignorewin = ['__Tagbar__' , 'vimfiler:default']
let g:spacevim_smartcloseignoreft = [
\ 'help',
\ 'tagbar',
\ 'vimfiler',
\ 'SpaceVimRunner',

View File

@ -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()

View File

@ -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=