fix: escape on save prompt cancels select (#76)

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:28:57 -05:00 committed by GitHub
parent a74747e1f5
commit 7a46246062
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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()