fix: set alternate when using floating windows (#526)

This commit is contained in:
David Marchante 2024-12-20 23:18:49 -05:00 committed by GitHub
parent 78ab7ca107
commit c5f7c56644
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 1 deletions

View file

@ -141,5 +141,17 @@ a.describe("Alternate buffer", function()
oil.close()
assert.equals("foo", vim.fn.expand("#"))
end)
a.it("preserves alternate when traversing to a new file", function()
vim.cmd.edit({ args = { "foo" } })
oil.open_float()
test_util.wait_for_autocmd({ "User", pattern = "OilEnter" })
assert.equals("foo", vim.fn.expand("#"))
test_util.feedkeys({ "/LICENSE<CR>" }, 10)
oil.select()
test_util.wait_for_autocmd("BufEnter")
assert.equals("LICENSE", vim.fn.expand("%:."))
assert.equals("foo", vim.fn.expand("#"))
end)
end)
end)