Merge #8929 from janlazo/vim-8.0.0983

This commit is contained in:
Justin M. Keyes 2018-08-28 22:39:02 +02:00 committed by GitHub
commit 885ca3b7a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 6 deletions

View File

@ -1279,15 +1279,14 @@ bool check_changed(buf_T *buf, int flags)
/// ///
/// @param buf /// @param buf
/// @param checkall may abandon all changed buffers /// @param checkall may abandon all changed buffers
void dialog_changed(buf_T *buf, int checkall) void dialog_changed(buf_T *buf, bool checkall)
{ {
char_u buff[DIALOG_MSG_SIZE]; char_u buff[DIALOG_MSG_SIZE];
int ret; int ret;
exarg_T ea; exarg_T ea;
dialog_msg(buff, _("Save changes to \"%s\"?"), assert(buf->b_fname != NULL);
(buf->b_fname != NULL) ? dialog_msg(buff, _("Save changes to \"%s\"?"), buf->b_fname);
buf->b_fname : (char_u *)_("Untitled"));
if (checkall) { if (checkall) {
ret = vim_dialog_yesnoallcancel(VIM_QUESTION, NULL, buff, 1); ret = vim_dialog_yesnoallcancel(VIM_QUESTION, NULL, buff, 1);
} else { } else {

View File

@ -2882,8 +2882,8 @@ close_others (
} }
if (!r) { if (!r) {
if (message && (p_confirm || cmdmod.confirm) && p_write) { if (message && (p_confirm || cmdmod.confirm) && p_write) {
dialog_changed(wp->w_buffer, FALSE); dialog_changed(wp->w_buffer, false);
if (!win_valid(wp)) { /* autocommands messed wp up */ if (!win_valid(wp)) { // autocommands messed wp up
nextwp = firstwin; nextwp = firstwin;
continue; continue;
} }