#427 Output buffer variables when buffer numbers are strings
This commit is contained in:
parent
6853d2c304
commit
447917e348
@ -113,5 +113,5 @@ endfunction
|
|||||||
function! ale#Var(buffer, variable_name) abort
|
function! ale#Var(buffer, variable_name) abort
|
||||||
let l:full_name = 'ale_' . a:variable_name
|
let l:full_name = 'ale_' . a:variable_name
|
||||||
|
|
||||||
return getbufvar(a:buffer, l:full_name, g:[l:full_name])
|
return getbufvar(str2nr(a:buffer), l:full_name, g:[l:full_name])
|
||||||
endfunction
|
endfunction
|
||||||
|
@ -12,5 +12,10 @@ Execute(ale#Var should return buffer overrides):
|
|||||||
|
|
||||||
AssertEqual 'def', ale#Var(bufnr(''), 'some_variable')
|
AssertEqual 'def', ale#Var(bufnr(''), 'some_variable')
|
||||||
|
|
||||||
|
Execute(ale#Var should return buffer overrides for buffer numbers as strings):
|
||||||
|
let b:ale_some_variable = 'def'
|
||||||
|
|
||||||
|
AssertEqual 'def', ale#Var(string(bufnr('')), 'some_variable')
|
||||||
|
|
||||||
Execute(ale#Var should throw exceptions for undefined variables):
|
Execute(ale#Var should throw exceptions for undefined variables):
|
||||||
AssertThrows call ale#Var(bufnr(''), 'undefined_variable_name')
|
AssertThrows call ale#Var(bufnr(''), 'undefined_variable_name')
|
||||||
|
Loading…
Reference in New Issue
Block a user