1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 22:20:06 +08:00

Merge pull request #1678 from wsdjeg/windows

Fix flygrep
This commit is contained in:
Wang Shidong 2018-05-01 15:05:01 +08:00 committed by GitHub
commit 2eb48ec0b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

View File

@ -199,9 +199,12 @@ function! SpaceVim#mapping#space#init() abort
\ . " expand(\"<cword>\"), 'dir' : input(\"arbitrary dir:\", '', 'dir')})", \ . " expand(\"<cword>\"), 'dir' : input(\"arbitrary dir:\", '', 'dir')})",
\ 'grep cursor word in arbitrary directory', 1) \ 'grep cursor word in arbitrary directory', 1)
" Searching in project " Searching in project
call SpaceVim#mapping#space#def('nnoremap', ['s', 'p'], "call SpaceVim#plugins#flygrep#open({'input' : input(\"grep pattern:\")})", call SpaceVim#mapping#space#def('nnoremap', ['s', 'p'],
\ 'call SpaceVim#plugins#flygrep#open(' .
\ "{'input' : input(\"grep pattern:\"), 'dir' : get(b:, \"rootDir\", getcwd())})",
\ 'grep in project', 1) \ 'grep in project', 1)
call SpaceVim#mapping#space#def('nnoremap', ['s', 'P'], "call SpaceVim#plugins#flygrep#open({'input' : expand(\"<cword>\")})", call SpaceVim#mapping#space#def('nnoremap', ['s', 'P'],
\ "call SpaceVim#plugins#flygrep#open({'input' : expand(\"<cword>\"), 'dir' : get(b:, \"rootDir\", getcwd())})",
\ 'grep cursor word in project', 1) \ 'grep cursor word in project', 1)
" Searching background " Searching background
call SpaceVim#mapping#space#def('nnoremap', ['s', 'j'], call SpaceVim#mapping#space#def('nnoremap', ['s', 'j'],

View File

@ -172,8 +172,8 @@ function! s:close_buffer() abort
if s:grep_timer_id != 0 if s:grep_timer_id != 0
call timer_stop(s:grep_timer_id) call timer_stop(s:grep_timer_id)
endif endif
pclose noautocmd pclose
q noautocmd q
endfunction endfunction
let s:MPT._onclose = function('s:close_buffer') let s:MPT._onclose = function('s:close_buffer')
" }}} " }}}
@ -415,7 +415,7 @@ function! SpaceVim#plugins#flygrep#open(agrv) abort
let s:mode = '' let s:mode = ''
" set default handle func: s:flygrep " set default handle func: s:flygrep
let s:MPT._handle_fly = function('s:flygrep') let s:MPT._handle_fly = function('s:flygrep')
rightbelow split __flygrep__ noautocmd rightbelow split __flygrep__
let s:flygrep_buffer_id = bufnr('%') let s:flygrep_buffer_id = bufnr('%')
setlocal buftype=nofile bufhidden=wipe nobuflisted nolist noswapfile nowrap cursorline nospell nonu norelativenumber setlocal buftype=nofile bufhidden=wipe nobuflisted nolist noswapfile nowrap cursorline nospell nonu norelativenumber
let save_tve = &t_ve let save_tve = &t_ve