Skip to content

Commit

Permalink
Fix #1800 - Enable non-blocking writes where available
Browse files Browse the repository at this point in the history
  • Loading branch information
w0rp committed Sep 6, 2018
1 parent 7086769 commit 580bd36
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions autoload/ale/job.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
11 changes: 9 additions & 2 deletions autoload/ale/socket.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 580bd36

Please sign in to comment.