summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-02-17 10:19:44 +0000
committerw0rp <devw0rp@gmail.com>2017-02-17 10:19:44 +0000
commitb21ca4ed4e09bd519ba2943aed17cff909dd71e2 (patch)
tree065f6135b89007d5a70f95d1314dbec3e6a07f2a /autoload
parentbdbf36991d2f21feb3be08cfa979c76e548577a1 (diff)
downloadale-b21ca4ed4e09bd519ba2943aed17cff909dd71e2.zip
Use a more reliable method for getting an ID for a job
Diffstat (limited to 'autoload')
-rw-r--r--autoload/ale/engine.vim20
1 files changed, 7 insertions, 13 deletions
diff --git a/autoload/ale/engine.vim b/autoload/ale/engine.vim
index 593876fb..61db4a1c 100644
--- a/autoload/ale/engine.vim
+++ b/autoload/ale/engine.vim
@@ -9,25 +9,19 @@
" output: The array of lines for the output of the job.
let s:job_info_map = {}
+function! ale#engine#ParseVim8ProcessID(job_string) abort
+ return matchstr(a:job_string, '\d\+') + 0
+endfunction
+
function! s:GetJobID(job) abort
if has('nvim')
"In NeoVim, job values are just IDs.
return a:job
endif
- " In Vim 8, the job is a special variable, and we open a channel for each
- " job. We'll use the ID of the channel instead as the job ID.
- try
- let l:channel_info = ch_info(job_getchannel(a:job))
-
- if !empty(l:channel_info)
- return l:channel_info.id
- endif
- catch
- endtry
-
- " If we fail to get the channel ID for a job, just return a 0 ID.
- return 0
+ " For Vim 8, the job is a different variable type, and we can parse the
+ " process ID from the string.
+ return ale#engine#ParseVim8ProcessID(string(a:job))
endfunction
function! ale#engine#InitBufferInfo(buffer) abort