summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-03-13 23:45:25 +0000
committerw0rp <devw0rp@gmail.com>2017-03-13 23:45:32 +0000
commit6f0fc965ab648104547dcbb5e120abfe09d6b0e8 (patch)
tree718d0b56b4503771f0b433ce9744b6c3bc054bf2
parentfae26369d415a14ce10739513c7f78273993a827 (diff)
downloadale-6f0fc965ab648104547dcbb5e120abfe09d6b0e8.zip
#394 Attempt to fix running linters when bufwinid() doesn't exist
-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.