aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/vim_spec.lua
diff options
context:
space:
mode:
authorSean Dewar <seandewar@users.noreply.github.com>2022-01-07 17:33:01 +0000
committerSean Dewar <seandewar@users.noreply.github.com>2022-02-03 15:03:08 +0000
commit6820420d3e7c153868e21d917596b3d1a19fa937 (patch)
tree3617a7baf1806b25fdeaf69c2dc66f3f3dcd69ac /test/functional/lua/vim_spec.lua
parentd984a8d130c2063dcd33ae52f98c22fe3567cd18 (diff)
downloadrneovim-6820420d3e7c153868e21d917596b3d1a19fa937.tar.gz
rneovim-6820420d3e7c153868e21d917596b3d1a19fa937.tar.bz2
rneovim-6820420d3e7c153868e21d917596b3d1a19fa937.zip
vim-patch:8.2.4028: ml_get error with :doautoall and Visual area
Problem: ml_get error with :doautoall and Visual area. (Sean Dewar) Solution: Disable Visual mode while executing autocommands. https://github.com/vim/vim/commit/cb1956d6f2aece8ad93e19e5d4c7e0b5e405f056 This should also fix #16937 for nvim_buf_call, so test for it.
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 ddcf7687f5..9a048211d4 100644
--- a/test/functional/lua/vim_spec.lua
+++ b/test/functional/lua/vim_spec.lua
@@ -2406,6 +2406,17 @@ describe('lua stdlib', function()
eq(buf1, meths.get_current_buf())
eq(buf2, val)
end)
+
+ it('does not cause ml_get errors with invalid visual selection', function()
+ -- Should be fixed by vim-patch:8.2.4028.
+ exec_lua [[
+ local a = vim.api
+ local t = function(s) return a.nvim_replace_termcodes(s, true, true, true) end
+ a.nvim_buf_set_lines(0, 0, -1, true, {"a", "b", "c"})
+ a.nvim_feedkeys(t "G<C-V>", "txn", false)
+ a.nvim_buf_call(a.nvim_create_buf(false, true), function() vim.cmd "redraw" end)
+ ]]
+ end)
end)
describe('vim.api.nvim_win_call', function()