From 91a1b6027f483407e6bcf41c85b90acb4b7b79a3 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Sat, 22 Apr 2017 13:30:15 +0800 Subject: [PATCH 1/8] Use job in neovim or vim8 --- autoload/SpaceVim/api/job.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/SpaceVim/api/job.vim b/autoload/SpaceVim/api/job.vim index e0d388769..9ca45b517 100644 --- a/autoload/SpaceVim/api/job.vim +++ b/autoload/SpaceVim/api/job.vim @@ -6,7 +6,7 @@ endfunction let s:self = {} let s:self.jobs = {} let s:self.nvim_job = has('nvim') -let s:self.vim_job = !has('nvim') && has('job') && has('patch-7.4.1590') +let s:self.vim_job = !has('nvim') && has('job') && has('patch-8.0.0027') function! s:self.warn(...) abort if len(a:000) == 0 echohl WarningMsg | echom 'Current version do not support job feature!' | echohl None From 607882765fc9588e893c7968f877920a9f4c0be1 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Sat, 22 Apr 2017 14:03:37 +0800 Subject: [PATCH 2/8] Fallback to sync system() --- autoload/SpaceVim/api/job.vim | 22 +++++++++++++++++++++- autoload/SpaceVim/api/vim/compatible.vim | 12 ++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/autoload/SpaceVim/api/job.vim b/autoload/SpaceVim/api/job.vim index 9ca45b517..4bb6a44c7 100644 --- a/autoload/SpaceVim/api/job.vim +++ b/autoload/SpaceVim/api/job.vim @@ -7,9 +7,12 @@ let s:self = {} let s:self.jobs = {} let s:self.nvim_job = has('nvim') let s:self.vim_job = !has('nvim') && has('job') && has('patch-8.0.0027') +if !s:self.nvim_job && !s:self.vim_job + let s:self.vim_co = SpaceVim#api#import('vim#compatible') +endif function! s:self.warn(...) abort if len(a:000) == 0 - echohl WarningMsg | echom 'Current version do not support job feature!' | echohl None + echohl WarningMsg | echom 'Current version do not support job feature, fallback to sync system()' | echohl None elseif len(a:000) == 1 && type(a:1) == type('') echohl WarningMsg | echom a:1| echohl None else @@ -89,6 +92,23 @@ function! s:self.start(argv, ...) abort return id else call self.warn() + if len(a:000) > 0 + let opts = a:1 + else + let opts = {} + endif + let output = self.vim_co.systemlist(a:argv) + let id = len(self.jobs) + 1 + if v:shell_error + if has_key(opts,'on_stderr') + call call(opts.on_stderr, [id, output, 'on_stderr']) + endif + else + if has_key(opts,'on_stdout') + call call(opts.on_stderr, [id, output, 'on_stdout']) + endif + endif + return id endif endfunction diff --git a/autoload/SpaceVim/api/vim/compatible.vim b/autoload/SpaceVim/api/vim/compatible.vim index 1395f4135..4d2718420 100644 --- a/autoload/SpaceVim/api/vim/compatible.vim +++ b/autoload/SpaceVim/api/vim/compatible.vim @@ -29,6 +29,9 @@ if has('nvim') function! s:system(cmd, ...) abort return a:0 == 0 ? system(a:cmd) : system(a:cmd, a:1) endfunction + function! s:systemlist(cmd, ...) abort + return a:0 == 0 ? systemlist(a:cmd) : systemlist(a:cmd, a:1) + endfunction else function! s:system(cmd, ...) abort if type(a:cmd) == 3 @@ -39,6 +42,15 @@ else return a:0 == 0 ? system(a:cmd) : system(a:cmd, a:1) endif endfunction + function! s:systemlist(cmd, ...) abort + if type(a:cmd) == 3 + let cmd = map(a:cmd, 'shellescape(v:val)') + let cmd = join(cmd, ' ') + return a:0 == 0 ? systemlist(cmd) : systemlist(cmd, a:1) + else + return a:0 == 0 ? systemlist(a:cmd) : systemlist(a:cmd, a:1) + endif + endfunction endif " vim:set et sw=2 cc=80: From 3e8a2dddc1e76485c86a91e040d1190aef03f977 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Sat, 22 Apr 2017 14:44:47 +0800 Subject: [PATCH 3/8] Add sync support --- autoload/SpaceVim/api/job.vim | 18 ++++++++++-------- autoload/SpaceVim/api/vim/compatible.vim | 1 + test/api/job.vader | 22 ++++++++++++++-------- 3 files changed, 25 insertions(+), 16 deletions(-) diff --git a/autoload/SpaceVim/api/job.vim b/autoload/SpaceVim/api/job.vim index 4bb6a44c7..269bee56c 100644 --- a/autoload/SpaceVim/api/job.vim +++ b/autoload/SpaceVim/api/job.vim @@ -5,11 +5,10 @@ endfunction " make vim and neovim use same job func. let s:self = {} let s:self.jobs = {} -let s:self.nvim_job = has('nvim') -let s:self.vim_job = !has('nvim') && has('job') && has('patch-8.0.0027') -if !s:self.nvim_job && !s:self.vim_job - let s:self.vim_co = SpaceVim#api#import('vim#compatible') -endif +let s:self.nvim_job = has('nvim') && 0 +let s:self.vim_job = !has('nvim') && has('job') && has('patch-8.0.0027') && 0 +let s:self.vim_co = SpaceVim#api#import('vim#compatible') + function! s:self.warn(...) abort if len(a:000) == 0 echohl WarningMsg | echom 'Current version do not support job feature, fallback to sync system()' | echohl None @@ -98,16 +97,19 @@ function! s:self.start(argv, ...) abort let opts = {} endif let output = self.vim_co.systemlist(a:argv) - let id = len(self.jobs) + 1 + let id = -1 if v:shell_error if has_key(opts,'on_stderr') - call call(opts.on_stderr, [id, output, 'on_stderr']) + call call(opts.on_stderr, [id, output, 'stderr']) endif else if has_key(opts,'on_stdout') - call call(opts.on_stderr, [id, output, 'on_stdout']) + call call(opts.on_stdout, [id, output, 'stdout']) endif endif + if has_key(opts,'on_exit') + call call(opts.on_exit, [id, v:shell_error, 'exit']) + endif return id endif endfunction diff --git a/autoload/SpaceVim/api/vim/compatible.vim b/autoload/SpaceVim/api/vim/compatible.vim index 4d2718420..2c1aa083d 100644 --- a/autoload/SpaceVim/api/vim/compatible.vim +++ b/autoload/SpaceVim/api/vim/compatible.vim @@ -2,6 +2,7 @@ function! SpaceVim#api#vim#compatible#get() abort return map({ \ 'execute' : '', \ 'system' : '', + \ 'systemlist' : '', \ }, \ "function('s:' . v:key)" \ ) diff --git a/test/api/job.vader b/test/api/job.vader index 5334373b0..295a4b1c7 100644 --- a/test/api/job.vader +++ b/test/api/job.vader @@ -3,7 +3,7 @@ Execute ( SpaceVim api: job ): let argv = ['cat'] let g:stdout = '' let stderr = '' - let exit = 1 + let exit_data = 1 function! s:on_stdout(id, data, event) abort if a:event ==# 'stdout' for a in a:data @@ -12,7 +12,7 @@ Execute ( SpaceVim api: job ): endif endfor elseif a:event ==# 'exit' - let g:exit = a:data + let g:exit_data = a:data else let g:stderr = a:data endif @@ -23,11 +23,17 @@ Execute ( SpaceVim api: job ): \ 'on_exit' : function('s:on_stdout'), \ } let jobid = job.start(argv,opt) - call job.send(jobid, 'foo') - sleep 10m - AssertEqual stdout, 'foo' - AssertEqual job.status(jobid), 'run' - call job.stop(jobid) - AssertEqual exit, 1 + if jobid >= 0 + call job.send(jobid, 'foo') + sleep 10m + AssertEqual stdout, 'foo' + AssertEqual job.status(jobid), 'run' + call job.stop(jobid) + AssertEqual exit_data, 1 + else + let jobid = job.start(['echo', 'foo'],opt) + AssertEqual stdout, 'foo' + AssertEqual exit_data, 0 + endif From e36df642c8dfda4337ae43f81acb7953cf634b60 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Sat, 22 Apr 2017 15:19:13 +0800 Subject: [PATCH 4/8] Fix build --- autoload/SpaceVim/api/job.vim | 1 - autoload/SpaceVim/plugins/manager.vim | 58 +++++++++++++++++++++------ 2 files changed, 46 insertions(+), 13 deletions(-) diff --git a/autoload/SpaceVim/api/job.vim b/autoload/SpaceVim/api/job.vim index 269bee56c..f4538fdfb 100644 --- a/autoload/SpaceVim/api/job.vim +++ b/autoload/SpaceVim/api/job.vim @@ -90,7 +90,6 @@ function! s:self.start(argv, ...) abort call extend(self.jobs, {id : job}) return id else - call self.warn() if len(a:000) > 0 let opts = a:1 else diff --git a/autoload/SpaceVim/plugins/manager.vim b/autoload/SpaceVim/plugins/manager.vim index 54895ba94..d9aaf7bbb 100644 --- a/autoload/SpaceVim/plugins/manager.vim +++ b/autoload/SpaceVim/plugins/manager.vim @@ -23,6 +23,7 @@ let s:building_repos = {} let s:ui_buf = {} let s:plugin_manager_buffer = 0 let s:plugin_manager_buffer_lines = [] +let s:jobpid = 0 " install plugin manager function! s:install_manager() abort @@ -168,6 +169,7 @@ function! SpaceVim#plugins#manager#update(...) abort elseif status == 1 return endif + redraw! let s:pct = 0 let s:pct_done = 0 let s:plugins = a:0 == 0 ? sort(keys(dein#get())) : sort(copy(a:1)) @@ -217,19 +219,27 @@ endfunction " here if a:data == 0, git pull succeed function! s:on_pull_exit(id, data, event) abort - if a:data == 0 && a:event ==# 'exit' - call s:msg_on_updated_done(s:pulling_repos[a:id].name) + if a:id == -1 + let id = s:jobpid else - call s:msg_on_updated_failed(s:pulling_repos[a:id].name) + let id = a:id endif - if get(s:pulling_repos[a:id], 'build', '') !=# '' - call s:build(s:pulling_repos[a:id]) + if a:data == 0 && a:event ==# 'exit' + call s:msg_on_updated_done(s:pulling_repos[id].name) + else + call s:msg_on_updated_failed(s:pulling_repos[id].name) + endif + if a:id == -1 + redraw! + endif + if get(s:pulling_repos[id], 'build', '') !=# '' + call s:build(s:pulling_repos[id]) else let s:pct_done += 1 call s:set_buf_line(s:plugin_manager_buffer, 1, 'Updating plugins (' . s:pct_done . '/' . s:total . ')') call s:set_buf_line(s:plugin_manager_buffer, 2, s:status_bar()) endif - call remove(s:pulling_repos, string(a:id)) + call remove(s:pulling_repos, string(id)) if !empty(s:plugins) let name = s:LIST.shift(s:plugins) if name ==# 'SpaceVim' @@ -242,7 +252,7 @@ function! s:on_pull_exit(id, data, event) abort endif call s:pull(repo) endif - if empty(s:pulling_repos) && empty(s:building_repos) + if empty(s:pulling_repos) && empty(s:building_repos) && !exists('s:recache_done') " TODO add elapsed time info. call s:set_buf_line(s:plugin_manager_buffer, 1, 'Updated. Elapsed time: ' \ . split(reltimestr(reltime(s:start_time)))[0] . ' sec.') @@ -250,6 +260,9 @@ function! s:on_pull_exit(id, data, event) abort if g:spacevim_plugin_manager ==# 'dein' call dein#recache_runtimepath() endif + if a:id == -1 + let s:recache_done = 1 + endif endif endfunction @@ -327,12 +340,23 @@ function! s:pull(repo) abort let s:pct += 1 let s:ui_buf[a:repo.name] = s:pct let argv = ['git', '-C', a:repo.path, 'pull'] - let jobid = s:JOB.start(argv,{ - \ 'on_exit' : function('s:on_pull_exit') - \ }) - if jobid != 0 - let s:pulling_repos[jobid] = a:repo + if s:JOB.vim_job || s:JOB.nvim_job + let jobid = s:JOB.start(argv,{ + \ 'on_exit' : function('s:on_pull_exit') + \ }) + if jobid != 0 + let s:pulling_repos[jobid] = a:repo + call s:msg_on_start(a:repo.name) + endif + else + let s:jobpid += 1 + let s:pulling_repos[s:jobpid] = a:repo call s:msg_on_start(a:repo.name) + redraw! + call s:JOB.start(argv,{ + \ 'on_exit' : function('s:on_pull_exit') + \ }) + endif endfunction @@ -353,6 +377,7 @@ endfunction function! s:build(repo) abort let argv = type(a:repo.build) != 4 ? a:repo.build : s:get_build_argv(a:repo.build) + if s:JOB.vim_job || s:JOB.nvim_job let jobid = s:JOB.start(argv,{ \ 'on_exit' : function('s:on_build_exit'), \ 'cwd' : a:repo.path, @@ -361,6 +386,15 @@ function! s:build(repo) abort let s:building_repos[jobid] = a:repo call s:msg_on_build_start(a:repo.name) endif + else + let s:building_repos[s:jobpid] = a:repo + call s:msg_on_build_start(a:repo.name) + redraw! + call s:JOB.start(argv,{ + \ 'on_exit' : function('s:on_build_exit') + \ }) + + endif endfunction function! s:msg_on_build_start(name) abort From 0f88225ab3eff914066c6363c30e601a090ac92a Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Sat, 22 Apr 2017 15:30:22 +0800 Subject: [PATCH 5/8] Add sync support --- autoload/SpaceVim/plugins/manager.vim | 47 +++++++++++++++------------ 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/autoload/SpaceVim/plugins/manager.vim b/autoload/SpaceVim/plugins/manager.vim index d9aaf7bbb..240e86cfa 100644 --- a/autoload/SpaceVim/plugins/manager.vim +++ b/autoload/SpaceVim/plugins/manager.vim @@ -172,6 +172,9 @@ function! SpaceVim#plugins#manager#update(...) abort redraw! let s:pct = 0 let s:pct_done = 0 + if exists('s:recache_done') + unlet s:recache_done + endif let s:plugins = a:0 == 0 ? sort(keys(dein#get())) : sort(copy(a:1)) if a:0 == 0 call add(s:plugins, 'SpaceVim') @@ -252,6 +255,11 @@ function! s:on_pull_exit(id, data, event) abort endif call s:pull(repo) endif + call s:recache_rtp(a:id) +endfunction + + +function! s:recache_rtp(id) abort if empty(s:pulling_repos) && empty(s:building_repos) && !exists('s:recache_done') " TODO add elapsed time info. call s:set_buf_line(s:plugin_manager_buffer, 1, 'Updated. Elapsed time: ' @@ -284,24 +292,21 @@ function! s:lock_revision(repo) abort endfunction function! s:on_build_exit(id, data, event) abort - if a:data == 0 && a:event ==# 'exit' - call s:msg_on_build_done(s:building_repos[a:id].name) + if a:id == -1 + let id = s:jobpid else - call s:msg_on_build_failed(s:building_repos[a:id].name) + let id = a:id + endif + if a:data == 0 && a:event ==# 'exit' + call s:msg_on_build_done(s:building_repos[id].name) + else + call s:msg_on_build_failed(s:building_repos[id].name) endif let s:pct_done += 1 call s:set_buf_line(s:plugin_manager_buffer, 1, 'Updating plugins (' . s:pct_done . '/' . s:total . ')') call s:set_buf_line(s:plugin_manager_buffer, 2, s:status_bar()) - call remove(s:building_repos, string(a:id)) - if empty(s:pulling_repos) && empty(s:building_repos) - " TODO add elapsed time info. - call s:set_buf_line(s:plugin_manager_buffer, 1, 'Installed. Elapsed time: ' - \ . split(reltimestr(reltime(s:start_time)))[0] . ' sec.') - let s:plugin_manager_buffer = 0 - if g:spacevim_plugin_manager ==# 'dein' - call dein#recache_runtimepath() - endif - endif + call remove(s:building_repos, string(id)) + call s:recache_rtp(a:id) endfunction " here if a:data == 0, git pull succeed @@ -378,14 +383,14 @@ endfunction function! s:build(repo) abort let argv = type(a:repo.build) != 4 ? a:repo.build : s:get_build_argv(a:repo.build) if s:JOB.vim_job || s:JOB.nvim_job - let jobid = s:JOB.start(argv,{ - \ 'on_exit' : function('s:on_build_exit'), - \ 'cwd' : a:repo.path, - \ }) - if jobid != 0 - let s:building_repos[jobid] = a:repo - call s:msg_on_build_start(a:repo.name) - endif + let jobid = s:JOB.start(argv,{ + \ 'on_exit' : function('s:on_build_exit'), + \ 'cwd' : a:repo.path, + \ }) + if jobid != 0 + let s:building_repos[jobid] = a:repo + call s:msg_on_build_start(a:repo.name) + endif else let s:building_repos[s:jobpid] = a:repo call s:msg_on_build_start(a:repo.name) From 83882ba74f209fab47f78346b35a4e0b194e87a2 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Sat, 22 Apr 2017 15:42:01 +0800 Subject: [PATCH 6/8] Fix build cwd option catch --- autoload/SpaceVim/api/job.vim | 8 ++++++++ autoload/SpaceVim/plugins/manager.vim | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/autoload/SpaceVim/api/job.vim b/autoload/SpaceVim/api/job.vim index f4538fdfb..b65f1d587 100644 --- a/autoload/SpaceVim/api/job.vim +++ b/autoload/SpaceVim/api/job.vim @@ -95,7 +95,15 @@ function! s:self.start(argv, ...) abort else let opts = {} endif + if has_key(opts, 'cwd') + let old_wd = getcwd() + let cwd = expand(opts.cwd, 1) + exe 'cd' fnameescape(cwd) + endif let output = self.vim_co.systemlist(a:argv) + if exists('old_wd') + exe 'cd' fnameescape(old_wd) + endif let id = -1 if v:shell_error if has_key(opts,'on_stderr') diff --git a/autoload/SpaceVim/plugins/manager.vim b/autoload/SpaceVim/plugins/manager.vim index 240e86cfa..a99231044 100644 --- a/autoload/SpaceVim/plugins/manager.vim +++ b/autoload/SpaceVim/plugins/manager.vim @@ -396,7 +396,8 @@ function! s:build(repo) abort call s:msg_on_build_start(a:repo.name) redraw! call s:JOB.start(argv,{ - \ 'on_exit' : function('s:on_build_exit') + \ 'on_exit' : function('s:on_build_exit'), + \ 'cwd' : a:repo.path, \ }) endif From f063f66bb6bdadc8bd8e0fda858c853e7dda80d9 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Sat, 22 Apr 2017 16:08:07 +0800 Subject: [PATCH 7/8] Fix install process --- autoload/SpaceVim/plugins/manager.vim | 67 ++++++++++++++++----------- 1 file changed, 39 insertions(+), 28 deletions(-) diff --git a/autoload/SpaceVim/plugins/manager.vim b/autoload/SpaceVim/plugins/manager.vim index a99231044..b4419d2e8 100644 --- a/autoload/SpaceVim/plugins/manager.vim +++ b/autoload/SpaceVim/plugins/manager.vim @@ -6,9 +6,6 @@ " License: MIT license "============================================================================= -" TODO add airline support for plugin manager -" TODO add install function for plugin manager - " Load SpaceVim api let s:VIM_CO = SpaceVim#api#import('vim#compatible') let s:JOB = SpaceVim#api#import('job') @@ -277,10 +274,15 @@ endfunction " @vimlint(EVL103, 1, a:event) function! s:on_install_stdout(id, data, event) abort + if a:id == -1 + let id = s:jobpid + else + let id = a:id + endif for str in a:data let status = matchstr(str,'\d\+%\s(\d\+/\d\+)') if !empty(status) - call s:msg_on_install_process(s:pulling_repos[a:id].name, status) + call s:msg_on_install_process(s:pulling_repos[id].name, status) endif endfor endfunction @@ -311,34 +313,31 @@ endfunction " here if a:data == 0, git pull succeed function! s:on_install_exit(id, data, event) abort - if a:data == 0 && a:event ==# 'exit' - call s:msg_on_install_done(s:pulling_repos[a:id].name) + if a:id == -1 + let id = s:jobpid else - call s:msg_on_install_failed(s:pulling_repos[a:id].name) + let id = a:id endif - if get(s:pulling_repos[a:id], 'rev', '') !=# '' - call s:lock_revision(s:pulling_repos[a:id]) + if a:data == 0 && a:event ==# 'exit' + call s:msg_on_install_done(s:pulling_repos[id].name) + else + call s:msg_on_install_failed(s:pulling_repos[id].name) endif - if get(s:pulling_repos[a:id], 'build', '') !=# '' - call s:build(s:pulling_repos[a:id]) + if get(s:pulling_repos[id], 'rev', '') !=# '' + call s:lock_revision(s:pulling_repos[id]) + endif + if get(s:pulling_repos[id], 'build', '') !=# '' + call s:build(s:pulling_repos[id]) else let s:pct_done += 1 call s:set_buf_line(s:plugin_manager_buffer, 1, 'Updating plugins (' . s:pct_done . '/' . s:total . ')') call s:set_buf_line(s:plugin_manager_buffer, 2, s:status_bar()) endif - call remove(s:pulling_repos, string(a:id)) + call remove(s:pulling_repos, string(id)) if !empty(s:plugins) call s:install(dein#get(s:LIST.shift(s:plugins))) endif - if empty(s:pulling_repos) && empty(s:building_repos) - " TODO add elapsed time info. - call s:set_buf_line(s:plugin_manager_buffer, 1, 'Installed. Elapsed time: ' - \ . split(reltimestr(reltime(s:start_time)))[0] . ' sec.') - let s:plugin_manager_buffer = 0 - if g:spacevim_plugin_manager ==# 'dein' - call dein#recache_runtimepath() - endif - endif + call s:recache_rtp(a:id) endfunction function! s:pull(repo) abort @@ -370,13 +369,25 @@ function! s:install(repo) abort let s:ui_buf[a:repo.name] = s:pct let url = 'https://github.com/' . a:repo.repo let argv = ['git', 'clone', '--progress', url, a:repo.path] - let jobid = s:JOB.start(argv,{ - \ 'on_stderr' : function('s:on_install_stdout'), - \ 'on_exit' : function('s:on_install_exit') - \ }) - if jobid != 0 - let s:pulling_repos[jobid] = a:repo - call s:msg_on_install_start(a:repo.name) + if s:JOB.vim_job || s:JOB.nvim_job + let jobid = s:JOB.start(argv,{ + \ 'on_stderr' : function('s:on_install_stdout'), + \ 'on_exit' : function('s:on_install_exit') + \ }) + if jobid != 0 + let s:pulling_repos[jobid] = a:repo + call s:msg_on_install_start(a:repo.name) + endif + else + let s:jobpid += 1 + let s:pulling_repos[s:jobpid] = a:repo + call s:msg_on_start(a:repo.name) + redraw! + call s:JOB.start(argv,{ + \ 'on_stderr' : function('s:on_install_stdout'), + \ 'on_exit' : function('s:on_install_exit') + \ }) + endif endfunction From 35c9f6542ee2bb0495a50cb9af9e961724516d61 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Sat, 22 Apr 2017 16:11:11 +0800 Subject: [PATCH 8/8] Enable job feature if it is supported --- autoload/SpaceVim/api/job.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/SpaceVim/api/job.vim b/autoload/SpaceVim/api/job.vim index b65f1d587..5db27f407 100644 --- a/autoload/SpaceVim/api/job.vim +++ b/autoload/SpaceVim/api/job.vim @@ -5,8 +5,8 @@ endfunction " make vim and neovim use same job func. let s:self = {} let s:self.jobs = {} -let s:self.nvim_job = has('nvim') && 0 -let s:self.vim_job = !has('nvim') && has('job') && has('patch-8.0.0027') && 0 +let s:self.nvim_job = has('nvim') +let s:self.vim_job = !has('nvim') && has('job') && has('patch-8.0.0027') let s:self.vim_co = SpaceVim#api#import('vim#compatible') function! s:self.warn(...) abort