fix: escape on save prompt cancels select
Problem: when `prompt_save_on_select_new_entry` is enabled and the user presses Escape on the "Save changes?" confirm dialog, `vim.fn.confirm` returns 0, but the select continued as if the user had chosen "No". Solution: add an explicit `choice == 0` branch that returns immediately, aborting the select without saving or opening any files.
This commit is contained in:
parent
a74747e1f5
commit
c42d500d83
2 changed files with 14 additions and 12 deletions
|
|
@ -716,6 +716,8 @@ M.select = function(opts, callback)
|
|||
local ok, choice = pcall(vim.fn.confirm, 'Save changes?', 'Yes\nNo', 1)
|
||||
if not ok then
|
||||
return finish()
|
||||
elseif choice == 0 then
|
||||
return
|
||||
elseif choice == 1 then
|
||||
M.save()
|
||||
return finish()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue