mirror of
https://github.com/neovim/neovim.git
synced 2025-10-09 19:36:40 +00:00
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 vim/vim#5878)
5259275347
This commit is contained in:
@@ -666,6 +666,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