fix(marks): handle switching buffer properly (#25763)

This commit is contained in:
zeertzjq
2023-10-24 16:10:36 +08:00
committed by GitHub
parent 25cfe3fd43
commit d432bba4e4
4 changed files with 58 additions and 2 deletions

View File

@@ -24,7 +24,6 @@ describe('named marks', function()
os.remove(file2)
end)
it("can be set", function()
command("edit " .. file1)
command("mark a")
@@ -147,6 +146,20 @@ describe('named marks', function()
eq({2, 2}, cursor())
end)
it("can move to them using :'", function()
command("args " .. file1 .. " " .. file2)
feed("j")
feed("ma")
feed("G")
command("'a")
eq({2, 0}, cursor())
feed("mA")
command("next")
command("'A")
eq(1, meths.get_current_buf().id)
eq({2, 0}, cursor())
end)
it("errors when it can't find the buffer", function()
command("args " .. file1 .. " " .. file2)
feed("mA")