File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
lua/nvim-tree/actions/node Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -319,6 +319,15 @@ local function open_in_new_window(filename, mode)
319319 end
320320 end
321321
322+ if (mode == " preview" or mode == " preview_no_picker" ) and view .View .float .enable then
323+ -- ignore "WinLeave" autocmd on preview
324+ -- because the registered "WinLeave"
325+ -- will kill the floating window immediately
326+ set_current_win_no_autocmd (target_winid , { " WinLeave" , " BufEnter" })
327+ else
328+ set_current_win_no_autocmd (target_winid , { " BufEnter" })
329+ end
330+
322331 local fname
323332 if M .relative_path then
324333 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)
336345 command = { cmd = " edit" , args = { fname } }
337346 end
338347
339- if (mode == " preview" or mode == " preview_no_picker" ) and view .View .float .enable then
340- -- ignore "WinLeave" autocmd on preview
341- -- because the registered "WinLeave"
342- -- will kill the floating window immediately
343- set_current_win_no_autocmd (target_winid , { " WinLeave" , " BufEnter" })
344- else
345- set_current_win_no_autocmd (target_winid , { " BufEnter" })
346- end
347-
348348 pcall (vim .api .nvim_cmd , command , { output = false })
349349 lib .set_target_win ()
350350end
You can’t perform that action at this time.
0 commit comments