Fix #1800 - Enable non-blocking writes where available

This commit is contained in:
w0rp
2018-09-06 20:04:35 +01:00
parent 7086769289
commit 580bd36773
2 changed files with 14 additions and 2 deletions

View File

@@ -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')