summaryrefslogtreecommitdiff
path: root/autoload/ale.vim
diff options
context:
space:
mode:
Diffstat (limited to 'autoload/ale.vim')
-rw-r--r--autoload/ale.vim11
1 files changed, 4 insertions, 7 deletions
diff --git a/autoload/ale.vim b/autoload/ale.vim
index dcc12150..8aa8bbd9 100644
--- a/autoload/ale.vim
+++ b/autoload/ale.vim
@@ -191,15 +191,12 @@ endfunction
"
" Every variable name will be prefixed with 'ale_'.
function! ale#Var(buffer, variable_name) abort
- let l:nr = str2nr(a:buffer)
let l:full_name = 'ale_' . a:variable_name
+ let l:vars = getbufvar(str2nr(a:buffer), '', 0)
- if bufexists(l:nr)
- let l:vars = getbufvar(l:nr, '')
- elseif has_key(g:, 'ale_fix_buffer_data')
- let l:vars = get(g:ale_fix_buffer_data, l:nr, {'vars': {}}).vars
- else
- let l:vars = {}
+ if l:vars is 0
+ " Look for variables from deleted buffers, saved from :ALEFix
+ let l:vars = get(get(g:ale_fix_buffer_data, a:buffer, {}), 'vars', {})
endif
return get(l:vars, l:full_name, g:[l:full_name])