fix issue with the description of epheien in #2819 Co-authored-by: eph <eph@MacBook-Pro.local>
This commit is contained in:
parent
d1957d3472
commit
12a9a995a4
@ -319,6 +319,15 @@ local function open_in_new_window(filename, mode)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if (mode == "preview" or mode == "preview_no_picker") and view.View.float.enable then
|
||||||
|
-- ignore "WinLeave" autocmd on preview
|
||||||
|
-- because the registered "WinLeave"
|
||||||
|
-- will kill the floating window immediately
|
||||||
|
set_current_win_no_autocmd(target_winid, { "WinLeave", "BufEnter" })
|
||||||
|
else
|
||||||
|
set_current_win_no_autocmd(target_winid, { "BufEnter" })
|
||||||
|
end
|
||||||
|
|
||||||
local fname
|
local fname
|
||||||
if M.relative_path then
|
if M.relative_path then
|
||||||
fname = utils.escape_special_chars(vim.fn.fnameescape(utils.path_relative(filename, vim.fn.getcwd())))
|
fname = utils.escape_special_chars(vim.fn.fnameescape(utils.path_relative(filename, vim.fn.getcwd())))
|
||||||
@ -336,15 +345,6 @@ local function open_in_new_window(filename, mode)
|
|||||||
command = { cmd = "edit", args = { fname } }
|
command = { cmd = "edit", args = { fname } }
|
||||||
end
|
end
|
||||||
|
|
||||||
if (mode == "preview" or mode == "preview_no_picker") and view.View.float.enable then
|
|
||||||
-- ignore "WinLeave" autocmd on preview
|
|
||||||
-- because the registered "WinLeave"
|
|
||||||
-- will kill the floating window immediately
|
|
||||||
set_current_win_no_autocmd(target_winid, { "WinLeave", "BufEnter" })
|
|
||||||
else
|
|
||||||
set_current_win_no_autocmd(target_winid, { "BufEnter" })
|
|
||||||
end
|
|
||||||
|
|
||||||
pcall(vim.api.nvim_cmd, command, { output = false })
|
pcall(vim.api.nvim_cmd, command, { output = false })
|
||||||
lib.set_target_win()
|
lib.set_target_win()
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user