mirror of
https://github.com/neovim/neovim.git
synced 2025-09-18 09:18:19 +00:00
vim-patch:9.1.1407: Can't use getpos('v') in OptionSet when using setbufvar() (#34177)
Problem: Can't use getpos('v') in OptionSet when using setbufvar(). Solution: Don't reset Visual selection when switching to the same buffer (zeertzjq). closes: vim/vim#173735717ee33db
(cherry picked from commitbd01bd6564
)
This commit is contained in:

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
5e0ef6afc7
commit
d1ca551983
@@ -3930,6 +3930,17 @@ stack traceback:
|
||||
]]
|
||||
)
|
||||
end)
|
||||
|
||||
it('can get Visual selection in current buffer #34162', function()
|
||||
insert('foo bar baz')
|
||||
feed('gg0fbvtb')
|
||||
local text = exec_lua([[
|
||||
return vim.api.nvim_buf_call(0, function()
|
||||
return vim.fn.getregion(vim.fn.getpos('.'), vim.fn.getpos('v'))
|
||||
end)
|
||||
]])
|
||||
eq({ 'bar ' }, text)
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('vim.api.nvim_win_call', function()
|
||||
|
Reference in New Issue
Block a user