aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/functional/shada/history_spec.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/functional/shada/history_spec.lua b/test/functional/shada/history_spec.lua
index b73a39f116..811afd268f 100644
--- a/test/functional/shada/history_spec.lua
+++ b/test/functional/shada/history_spec.lua
@@ -102,4 +102,26 @@ describe('ShaDa support code', function()
eq('Test 2', nvim_eval('histget("@", -1)'))
eq('c', nvim_eval('histget(">", -1)'))
end)
+
+ it('dumps and loads last search pattern with offset', function()
+ nvim_eval('setline(".", ["foo", "bar"])')
+ nvim_feed('gg0/a/e+1\n')
+ eq({0, 2, 3, 0}, nvim_eval('getpos(".")'))
+ nvim_command('wviminfo')
+ reset()
+ nvim_eval('setline(".", ["foo", "bar"])')
+ nvim_feed('gg0n')
+ eq({0, 2, 3, 0}, nvim_eval('getpos(".")'))
+ end)
+
+ it('dumps and loads last substitute pattern and replacement string', function()
+ nvim_eval('setline(".", ["foo", "bar"])')
+ nvim_command('%s/f/g/g')
+ eq('goo', nvim_eval('getline(1)'))
+ nvim_command('wviminfo')
+ reset()
+ nvim_eval('setline(".", ["foo", "bar"])')
+ nvim_command('&')
+ eq('goo', nvim_eval('getline(1)'))
+ end)
end)