fix: set alternate buffer when inside oil (#60)

This commit is contained in:
Steven Arcangeli 2023-02-24 06:20:56 -08:00
parent 647c2d316c
commit f1131b5e90
2 changed files with 17 additions and 0 deletions

View file

@ -70,6 +70,17 @@ a.describe("Alternate buffer", function()
assert.equals("foo", vim.fn.expand("#"))
end)
a.it("sets previous buffer as alternate when inside oil buffer", function()
vim.cmd.edit({ args = { "foo" } })
oil.open()
test_util.wait_for_autocmd("BufReadPost")
assert.equals("foo", vim.fn.expand("#"))
vim.cmd.edit({ args = { "bar" } })
assert.equals("foo", vim.fn.expand("#"))
oil.open()
assert.equals("bar", vim.fn.expand("#"))
end)
a.describe("floating window", function()
a.it("sets previous buffer as alternate", function()
vim.cmd.edit({ args = { "foo" } })