forked from aniani/vim
patch 9.1.0267: File name entered in GUI dialog is ignored
Problem: File name entered in GUI dialog is ignored (after v9.1.0265) Solution: Only set file name to "Untitled" if GUI dialog didn't set it. (zeertzjq) closes: #14417 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
parent
b73faa1c02
commit
c20bdf1107
@ -164,7 +164,6 @@ dialog_changed(
|
|||||||
int ret;
|
int ret;
|
||||||
buf_T *buf2;
|
buf_T *buf2;
|
||||||
exarg_T ea;
|
exarg_T ea;
|
||||||
int empty_buf = buf->b_fname == NULL ? TRUE : FALSE;
|
|
||||||
|
|
||||||
dialog_msg(buff, _("Save changes to \"%s\"?"), buf->b_fname);
|
dialog_msg(buff, _("Save changes to \"%s\"?"), buf->b_fname);
|
||||||
if (checkall)
|
if (checkall)
|
||||||
@ -178,11 +177,14 @@ dialog_changed(
|
|||||||
|
|
||||||
if (ret == VIM_YES)
|
if (ret == VIM_YES)
|
||||||
{
|
{
|
||||||
|
int empty_bufname;
|
||||||
|
|
||||||
#ifdef FEAT_BROWSE
|
#ifdef FEAT_BROWSE
|
||||||
// May get file name, when there is none
|
// May get file name, when there is none
|
||||||
browse_save_fname(buf);
|
browse_save_fname(buf);
|
||||||
#endif
|
#endif
|
||||||
if (empty_buf)
|
empty_bufname = buf->b_fname == NULL ? TRUE : FALSE;
|
||||||
|
if (empty_bufname)
|
||||||
buf_set_name(buf->b_fnum, (char_u *)"Untitled");
|
buf_set_name(buf->b_fnum, (char_u *)"Untitled");
|
||||||
|
|
||||||
if (check_overwrite(&ea, buf, buf->b_fname, buf->b_ffname, FALSE) == OK)
|
if (check_overwrite(&ea, buf, buf->b_fname, buf->b_ffname, FALSE) == OK)
|
||||||
@ -193,14 +195,11 @@ dialog_changed(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// restore to empty when write failed
|
// restore to empty when write failed
|
||||||
if (empty_buf)
|
if (empty_bufname)
|
||||||
{
|
{
|
||||||
vim_free(buf->b_fname);
|
VIM_CLEAR(buf->b_fname);
|
||||||
buf->b_fname = NULL;
|
VIM_CLEAR(buf->b_ffname);
|
||||||
vim_free(buf->b_ffname);
|
VIM_CLEAR(buf->b_sfname);
|
||||||
buf->b_ffname = NULL;
|
|
||||||
vim_free(buf->b_sfname);
|
|
||||||
buf->b_sfname = NULL;
|
|
||||||
unchanged(buf, TRUE, FALSE);
|
unchanged(buf, TRUE, FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -704,6 +704,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
267,
|
||||||
/**/
|
/**/
|
||||||
266,
|
266,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user