diff options
author | w0rp <devw0rp@gmail.com> | 2018-09-06 20:04:35 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2018-09-06 20:04:35 +0100 |
commit | 580bd3677344aa2f3d2f0d3d6ee3405cae6abf54 (patch) | |
tree | 598298c9b65ece07db0cec918ca4cfa958279f37 /autoload | |
parent | 70867692894aa99e9ef450f19f5ff7b571b98aad (diff) | |
download | ale-580bd3677344aa2f3d2f0d3d6ee3405cae6abf54.zip |
Fix #1800 - Enable non-blocking writes where available
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/ale/job.vim | 5 | ||||
-rw-r--r-- | autoload/ale/socket.vim | 11 |
2 files changed, 14 insertions, 2 deletions
diff --git a/autoload/ale/job.vim b/autoload/ale/job.vim index 1fe470f8..0117c7dd 100644 --- a/autoload/ale/job.vim +++ b/autoload/ale/job.vim @@ -249,6 +249,11 @@ function! ale#job#Start(command, options) abort let l:job_options.exit_cb = function('s:VimExitCallback') endif + " Use non-blocking writes for Vim versions that support the option. + if has('patch-8.1.350') + let l:job_options.noblock = 1 + endif + " Vim 8 will read the stdin from the file's buffer. let l:job_info.job = job_start(a:command, l:job_options) let l:job_id = ale#job#ParseVim8ProcessID(string(l:job_info.job)) diff --git a/autoload/ale/socket.vim b/autoload/ale/socket.vim index 5ea49c7b..7e069fb5 100644 --- a/autoload/ale/socket.vim +++ b/autoload/ale/socket.vim @@ -55,11 +55,18 @@ function! ale#socket#Open(address, options) abort if !has('nvim') " Vim - let l:channel_info.channel = ch_open(a:address, { + let l:channel_options = { \ 'mode': l:mode, \ 'waittime': 0, \ 'callback': function('s:VimOutputCallback'), - \}) + \} + + " Use non-blocking writes for Vim versions that support the option. + if has('patch-8.1.350') + let l:channel_options.noblock = 1 + endif + + let l:channel_info.channel = ch_open(a:address, l:channel_options) let l:vim_info = ch_info(l:channel_info.channel) let l:channel_id = !empty(l:vim_info) ? l:vim_info.id : -1 elseif exists('*chansend') && exists('*sockconnect') |