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:
Barrett Ruth 2026-03-06 16:01:29 -05:00
parent a74747e1f5
commit c42d500d83
Signed by: barrett
GPG key ID: A6C96C9349D2FC81
2 changed files with 14 additions and 12 deletions

View file

@ -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()