fix: set alternate when using floating windows (#526)
This commit is contained in:
parent
78ab7ca107
commit
c5f7c56644
2 changed files with 13 additions and 1 deletions
|
|
@ -720,7 +720,7 @@ M.select = function(opts, callback)
|
||||||
vertical = opts.vertical,
|
vertical = opts.vertical,
|
||||||
horizontal = opts.horizontal,
|
horizontal = opts.horizontal,
|
||||||
split = opts.split,
|
split = opts.split,
|
||||||
keepalt = true,
|
keepalt = false,
|
||||||
}
|
}
|
||||||
local filebufnr = vim.fn.bufadd(normalized_url)
|
local filebufnr = vim.fn.bufadd(normalized_url)
|
||||||
local entry_is_file = not vim.endswith(normalized_url, "/")
|
local entry_is_file = not vim.endswith(normalized_url, "/")
|
||||||
|
|
|
||||||
|
|
@ -141,5 +141,17 @@ a.describe("Alternate buffer", function()
|
||||||
oil.close()
|
oil.close()
|
||||||
assert.equals("foo", vim.fn.expand("#"))
|
assert.equals("foo", vim.fn.expand("#"))
|
||||||
end)
|
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)
|
||||||
end)
|
end)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue