Skip to content

Commit 168826f

Browse files
committed
fix: use pcall correctly to fix 325 error, fixes #567
1 parent eca6973 commit 168826f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lua/neo-tree/sources/common/commands.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ local use_window_picker = function(state, path, cmd)
641641
local picked_window_id = picker.pick_window()
642642
if picked_window_id then
643643
vim.api.nvim_set_current_win(picked_window_id)
644-
local result, err = vim.cmd(cmd .. " " .. vim.fn.fnameescape(path))
644+
local result, err = pcall(vim.cmd, cmd .. " " .. vim.fn.fnameescape(path))
645645
if result or err == "Vim(edit):E325: ATTENTION" then
646646
-- fixes #321
647647
vim.api.nvim_buf_set_option(0, "buflisted", true)

0 commit comments

Comments
 (0)