1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 02:20:05 +08:00
* Fix vim8 support

* Fix vim8 job support
This commit is contained in:
Wang Shidong 2017-07-02 11:17:05 -05:00 committed by GitHub
parent 4c8bb2272d
commit c94e6613b3
2 changed files with 7 additions and 1 deletions

View File

@ -21,6 +21,7 @@ function! s:self.warp(argv, opts) abort
let obj = {}
let obj._argv = a:argv
let obj._opts = a:opts
let obj.in_io = get(a:opts, 'in_io', 'pipe')
" @vimlint(EVL103, 1, a:job_id)
function! obj._out_cb(job_id, data) abort
if has_key(self._opts, 'on_stdout')
@ -45,6 +46,7 @@ function! s:self.warp(argv, opts) abort
\ 'argv': a:argv,
\ 'opts': {
\ 'mode': 'nl',
\ 'in_io' : obj.in_io,
\ 'out_cb': obj._out_cb,
\ 'err_cb': obj._err_cb,
\ 'exit_cb': obj._exit_cb,

View File

@ -1,12 +1,16 @@
let s:JOB = SpaceVim#api#import('job')
let s:rst = []
function! SpaceVim#plugins#searcher#find(expr, exe)
if empty(a:expr)
let expr = input('search expr: ')
else
let expr = a:expr
endif
call jobstart(s:get_search_cmd(a:exe, expr), {
call s:JOB.start(s:get_search_cmd(a:exe, expr), {
\ 'on_stdout' : function('s:search_stdout'),
\ 'in_io' : 'null',
\ 'on_exit' : function('s:search_exit'),
\ })
endfunction