1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-24 05:30:07 +08:00
This commit is contained in:
wsdjeg 2018-01-22 22:08:21 +08:00
parent b56ec04ea9
commit e2ae5b0cb9
2 changed files with 7 additions and 4 deletions

View File

@ -20,8 +20,8 @@ let s:search_tools.t.recursive_opt = ''
let s:search_tools.r = {}
let s:search_tools.r.command = 'rg'
let s:search_tools.r.default_opts = '--hidden --no-heading --vimgrep -S'
let s:search_tools.r.recursive_opt = ''
let s:search_tools.r.default_opts = ['--hidden', '--no-heading', '--vimgrep', '-S']
let s:search_tools.r.recursive_opt = []
let s:search_tools.k = {}
let s:search_tools.k.command = 'ack'
@ -94,6 +94,7 @@ function! SpaceVim#mapping#search#default_tool()
let key = s:search_tools.namespace[t]
let s:search_tools.default_opt = s:search_tools[key]['default_opts']
let s:search_tools.default_ropt = s:search_tools[key]['recursive_opt']
break
endif
endfor
endif

View File

@ -44,7 +44,9 @@ let s:grep_timer_id = 0
" @vimlint(EVL103, 1, a:timer)
function! s:grep_timer(timer) abort
let s:grepid = s:JOB.start(s:get_search_cmd(s:grep_expr), {
let cmd = s:get_search_cmd(s:grep_expr)
call SpaceVim#logger#info('grep cmd: ' . string(cmd))
let s:grepid = s:JOB.start(cmd, {
\ 'on_stdout' : function('s:grep_stdout'),
\ 'on_stderr' : function('s:grep_stderr'),
\ 'in_io' : 'null',
@ -130,7 +132,7 @@ endfunction
" @vimlint(EVL103, 0, a:event)
function! s:get_search_cmd(expr) abort
let cmd = [s:grep_exe] + [s:grep_opt]
let cmd = [s:grep_exe] + s:grep_opt
if !empty(s:grep_files) && type(s:grep_files) == 3
return cmd + [a:expr] + s:grep_files
elseif !empty(s:grep_files) && type(s:grep_files) == 1