summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--autoload/ale/list.vim11
1 files changed, 10 insertions, 1 deletions
diff --git a/autoload/ale/list.vim b/autoload/ale/list.vim
index 7b846761..6486d906 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.