Skip to content

Commit

Permalink
fix(prompt): confirm cwd changing using vim.fn.comfirm
Browse files Browse the repository at this point in the history
  • Loading branch information
konosubakonoakua committed Jan 29, 2024
1 parent e578fe7 commit 49cd10d
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions lua/neo-tree/command/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -219,14 +219,13 @@ handle_reveal = function(args, state)
elseif not utils.is_subpath(cwd, path) then
-- force was not specified, so we need to ask the user
cwd, _ = utils.split_path(path)
inputs.confirm("File not in cwd. Change cwd to " .. cwd .. "?", function(response)
if response == true then
args.dir = cwd
else
args.reveal_file = nil
end
do_show_or_focus(args, state, true)
end)
local response = vim.fn.confirm("File not in cwd. Change cwd to " .. (cwd or "nil") .. " ?", "&y[Y]\n&n[N]")
if response == true then
args.dir = cwd
else
args.reveal_file = nil
end
do_show_or_focus(args, state, true)
return
else
do_show_or_focus(args, state, true)
Expand Down

0 comments on commit 49cd10d

Please sign in to comment.