From 6f0fc965ab648104547dcbb5e120abfe09d6b0e8 Mon Sep 17 00:00:00 2001 From: w0rp Date: Mon, 13 Mar 2017 23:45:25 +0000 Subject: [PATCH] #394 Attempt to fix running linters when bufwinid() doesn't exist --- autoload/ale/list.vim | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/autoload/ale/list.vim b/autoload/ale/list.vim index 7b84676..6486d90 100644 --- a/autoload/ale/list.vim +++ b/autoload/ale/list.vim @@ -15,7 +15,16 @@ function! ale#list#SetLists(buffer, loclist) abort if g:ale_set_quickfix call setqflist(a:loclist) elseif g:ale_set_loclist - call setloclist(bufwinid(str2nr(a:buffer)), a:loclist) + " If windows support is off, bufwinid() may not exist. + if exists('*bufwinid') + " Set the results on the window for the buffer. + call setloclist(bufwinid(str2nr(a:buffer)), a:loclist) + else + " Set the results in the current window. + " This may not be the same window we ran the linters for, but + " it's better than nothing. + call setloclist(0, a:loclist) + endif endif " If we don't auto-open lists, bail out here.