forked from aniani/vim
patch 8.2.0507: getbufvar() may get the wrong dictionary
Problem: Getbufvar() may get the wrong dictionary. (David le Blanc) Solution: Check for empty name. (closes #5878)
This commit is contained in:
@@ -841,6 +841,16 @@ func Test_getbufvar()
|
||||
call assert_equal('iso-8859-2', getbufvar(bufnr('%'), '&fenc'))
|
||||
close
|
||||
|
||||
" Get the b: dict.
|
||||
let b:testvar = 'one'
|
||||
new
|
||||
let b:testvar = 'two'
|
||||
let thebuf = bufnr()
|
||||
wincmd w
|
||||
call assert_equal('two', getbufvar(thebuf, 'testvar'))
|
||||
call assert_equal('two', getbufvar(thebuf, '').testvar)
|
||||
bwipe!
|
||||
|
||||
set fileformats&
|
||||
endfunc
|
||||
|
||||
|
Reference in New Issue
Block a user