fix: renaming buffers doesn't interfere with directory hijack (#25)
This commit is contained in:
parent
80f64dd630
commit
b4ccc16944
3 changed files with 45 additions and 15 deletions
|
|
@ -556,7 +556,11 @@ M.setup = function(opts)
|
|||
loading.set_loading(bufnr, true)
|
||||
local function finish(new_url)
|
||||
if new_url ~= params.file then
|
||||
util.rename_buffer(bufnr, new_url)
|
||||
if util.rename_buffer(bufnr, new_url) then
|
||||
-- If the buffer was replaced then don't initialize it. It's dead. The replacement will
|
||||
-- have BufReadCmd called for it
|
||||
return
|
||||
end
|
||||
end
|
||||
vim.cmd.doautocmd({ args = { "BufReadPre", params.file }, mods = { emsg_silent = true } })
|
||||
view.initialize(bufnr)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue