aboutsummaryrefslogtreecommitdiff
path: root/test/functional/shada/history_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/shada/history_spec.lua')
-rw-r--r--test/functional/shada/history_spec.lua22
1 files changed, 20 insertions, 2 deletions
diff --git a/test/functional/shada/history_spec.lua b/test/functional/shada/history_spec.lua
index 1123f829d2..94513945d0 100644
--- a/test/functional/shada/history_spec.lua
+++ b/test/functional/shada/history_spec.lua
@@ -107,14 +107,32 @@ describe('ShaDa support code', function()
end)
it('dumps and loads last search pattern with offset', function()
- funcs.setline('.', {'foo', 'bar'})
+ meths.set_option('wrapscan', false)
+ funcs.setline('.', {'foo', 'bar--'})
nvim_feed('gg0/a/e+1\n')
eq({0, 2, 3, 0}, funcs.getpos('.'))
nvim_command('wshada')
reset()
- funcs.setline('.', {'foo', 'bar'})
+ meths.set_option('wrapscan', false)
+ funcs.setline('.', {'foo', 'bar--'})
nvim_feed('gg0n')
eq({0, 2, 3, 0}, funcs.getpos('.'))
+ eq(1, meths.get_vvar('searchforward'))
+ end)
+
+ it('dumps and loads last search pattern with offset and backward direction',
+ function()
+ meths.set_option('wrapscan', false)
+ funcs.setline('.', {'foo', 'bar--'})
+ nvim_feed('G$?a?e+1\n')
+ eq({0, 2, 3, 0}, funcs.getpos('.'))
+ nvim_command('wshada')
+ reset()
+ meths.set_option('wrapscan', false)
+ funcs.setline('.', {'foo', 'bar--'})
+ nvim_feed('G$n')
+ eq({0, 2, 3, 0}, funcs.getpos('.'))
+ eq(0, meths.get_vvar('searchforward'))
end)
it('saves v:hlsearch=1', function()