[nvim] show filename in a confirmation prompt for Bbye

This commit is contained in:
Dmytro Meleshko 2021-05-25 19:58:01 +03:00
parent a281507269
commit 7ded7fc2f3

View file

@ -43,7 +43,8 @@ endif
function s:CloseBuffer(cmd) abort function s:CloseBuffer(cmd) abort
let cmd = a:cmd let cmd = a:cmd
if &modified if &modified
let answer = confirm("Save changes?", "&Yes\n&No\n&Cancel") " <https://github.com/neovim/neovim/blob/a282a177d3320db25fa8f854cbcdbe0bc6abde7f/src/nvim/ex_cmds2.c#L1400>
let answer = confirm("Save changes to \"".expand('%')."\"?", "&Yes\n&No\n&Cancel")
if answer ==# 1 " Yes if answer ==# 1 " Yes
write write
elseif answer ==# 2 " No elseif answer ==# 2 " No