File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
lua/telescope/_extensions Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,28 @@ local create_delete_failure_handler = function(prompt_bufnr)
4848 end
4949end
5050
51+ local confirm_deletion = function ()
52+ if not git_worktree ._config .confirm_telescope_deletions then
53+ return true
54+ end
55+
56+ local confirmation = vim .fn .input (
57+ string.format (" Delete worktree? [y/n]: " )
58+ )
59+
60+ if string.sub (string.lower (confirmation ), 0 , 1 ) == " y" then
61+ return true
62+ end
63+
64+ print (" Didn't delete worktree" )
65+ return false
66+ end
67+
5168delete_worktree = function (prompt_bufnr , force )
69+ if not confirm_deletion () then
70+ return
71+ end
72+
5273 local worktree_path = get_worktree_path (prompt_bufnr )
5374 actions .close (prompt_bufnr )
5475 if worktree_path ~= nil then
You can’t perform that action at this time.
0 commit comments