aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/vim_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2025-05-26 06:51:15 +0800
committerGitHub <noreply@github.com>2025-05-25 22:51:15 +0000
commitbd01bd6564790d977095447ae70082c97fbbd480 (patch)
tree9b5708a5850fca5d68660d98dd0f4d2cb7e35454 /test/functional/lua/vim_spec.lua
parent4db58f78b49feb685555580e44fd338525331be3 (diff)
downloadrneovim-bd01bd6564790d977095447ae70082c97fbbd480.tar.gz
rneovim-bd01bd6564790d977095447ae70082c97fbbd480.tar.bz2
rneovim-bd01bd6564790d977095447ae70082c97fbbd480.zip
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#17373 https://github.com/vim/vim/commit/5717ee33db0048a496e8bed0b0cb20133b3f76ca
Diffstat (limited to 'test/functional/lua/vim_spec.lua')
-rw-r--r--test/functional/lua/vim_spec.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/functional/lua/vim_spec.lua b/test/functional/lua/vim_spec.lua
index 0a76af70d1..1cada42403 100644
--- a/test/functional/lua/vim_spec.lua
+++ b/test/functional/lua/vim_spec.lua
@@ -3955,6 +3955,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()