aboutsummaryrefslogtreecommitdiff
path: root/test/functional/shada/marks_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/shada/marks_spec.lua')
-rw-r--r--test/functional/shada/marks_spec.lua31
1 files changed, 28 insertions, 3 deletions
diff --git a/test/functional/shada/marks_spec.lua b/test/functional/shada/marks_spec.lua
index 955a6f382b..fa760ceb5b 100644
--- a/test/functional/shada/marks_spec.lua
+++ b/test/functional/shada/marks_spec.lua
@@ -1,5 +1,5 @@
-- ShaDa marks saving/reading support
-local helpers = require('test.functional.helpers')
+local helpers = require('test.functional.helpers')(after_each)
local meths, curwinmeths, curbufmeths, nvim_command, funcs, eq =
helpers.meths, helpers.curwinmeths, helpers.curbufmeths, helpers.command,
helpers.funcs, helpers.eq
@@ -100,6 +100,18 @@ describe('ShaDa support code', function()
eq(2, nvim_current_line())
end)
+ it('is able to dump and read back mark " from a closed tab', function()
+ nvim_command('edit ' .. testfilename)
+ nvim_command('tabedit ' .. testfilename_2)
+ nvim_command('2')
+ nvim_command('q!')
+ nvim_command('qall')
+ reset()
+ nvim_command('edit ' .. testfilename_2)
+ nvim_command('normal! `"')
+ eq(2, nvim_current_line())
+ end)
+
it('is able to populate v:oldfiles', function()
nvim_command('edit ' .. testfilename)
local tf_full = curbufmeths.get_name()
@@ -139,6 +151,19 @@ describe('ShaDa support code', function()
eq(saved, redir_exec('jumps'))
end)
+ it('when dumping jump list also dumps current position', function()
+ nvim_command('edit ' .. testfilename)
+ nvim_command('normal! G')
+ nvim_command('split ' .. testfilename_2)
+ nvim_command('normal! G')
+ nvim_command('wshada')
+ nvim_command('quit')
+ nvim_command('rshada')
+ nvim_command('normal! \15') -- <C-o>
+ eq(testfilename_2, funcs.bufname('%'))
+ eq({2, 0}, curwinmeths.get_cursor())
+ end)
+
it('is able to dump and restore jump list with different times (slow!)',
function()
nvim_command('edit ' .. testfilename_2)
@@ -180,8 +205,8 @@ describe('ShaDa support code', function()
reset()
nvim_command('edit ' .. testfilename)
nvim_command('normal! Gg;')
- -- Note: without “sync” “commands” test has good changes to fail for unknown
- -- reason (in first eq expected 1 is compared with 2). Any command inserted
+ -- Note: without “sync” “commands” test has good changes to fail for unknown
+ -- reason (in first eq expected 1 is compared with 2). Any command inserted
-- causes this to work properly.
nvim_command('" sync')
eq(1, nvim_current_line())