aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/vim_spec.lua
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2022-08-22 15:52:25 -0600
committerJosh Rahm <rahm@google.com>2022-08-22 15:52:25 -0600
commit24c75e4f7be4eb4052939e7d5db7721d88288604 (patch)
tree55e6e0c8e5f45e7ac007f33f025f98ad2921af36 /test/functional/api/vim_spec.lua
parentbf37d6bbd02d79fd86dc7740f0c27ebb1b5f5903 (diff)
parentbaaaa1f2b3b6ae3a989d1362a27e55dc7b0b148a (diff)
downloadrneovim-24c75e4f7be4eb4052939e7d5db7721d88288604.tar.gz
rneovim-24c75e4f7be4eb4052939e7d5db7721d88288604.tar.bz2
rneovim-24c75e4f7be4eb4052939e7d5db7721d88288604.zip
Merge remote-tracking branch 'upstream/master' into userreg
Diffstat (limited to 'test/functional/api/vim_spec.lua')
-rw-r--r--test/functional/api/vim_spec.lua49
1 files changed, 49 insertions, 0 deletions
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua
index 72a03c409a..24d0b6da45 100644
--- a/test/functional/api/vim_spec.lua
+++ b/test/functional/api/vim_spec.lua
@@ -3668,6 +3668,55 @@ describe('API', function()
:^ |
]])
end)
+ it('does not move cursor or change search history/pattern #19878 #19890', function()
+ meths.buf_set_lines(0, 0, -1, true, {'foo', 'bar', 'foo', 'bar'})
+ eq({1, 0}, meths.win_get_cursor(0))
+ eq('', funcs.getreg('/'))
+ eq('', funcs.histget('search'))
+ feed(':') -- call the API in cmdline mode to test whether it changes search history
+ eq({
+ cmd = 'normal',
+ args = {'x'},
+ bang = true,
+ range = {3, 4},
+ count = -1,
+ reg = '',
+ addr = 'line',
+ magic = {
+ file = false,
+ bar = false,
+ },
+ nargs = '+',
+ nextcmd = '',
+ mods = {
+ browse = false,
+ confirm = false,
+ emsg_silent = false,
+ filter = {
+ pattern = "",
+ force = false,
+ },
+ hide = false,
+ keepalt = false,
+ keepjumps = false,
+ keepmarks = false,
+ keeppatterns = false,
+ lockmarks = false,
+ noautocmd = false,
+ noswapfile = false,
+ sandbox = false,
+ silent = false,
+ split = "",
+ tab = 0,
+ unsilent = false,
+ verbose = -1,
+ vertical = false,
+ }
+ }, meths.parse_cmd('+2;/bar/normal! x', {}))
+ eq({1, 0}, meths.win_get_cursor(0))
+ eq('', funcs.getreg('/'))
+ eq('', funcs.histget('search'))
+ end)
end)
describe('nvim_cmd', function()
it('works', function ()