summaryrefslogtreecommitdiff
path: root/src/ex_cmds.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2004-10-11 10:16:09 +0000
committerBram Moolenaar <Bram@vim.org>2004-10-11 10:16:09 +0000
commit7b0294cb9f7cfcd3fcbbaa523578847a3e6d74c5 (patch)
tree5675edfe10a80abd76b307b855858f136c647d32 /src/ex_cmds.c
parent7171abea1ad8d33cce89a9664873417187139a53 (diff)
downloadvim-git-7b0294cb9f7cfcd3fcbbaa523578847a3e6d74c5.tar.gz
updated for version 7.0018v7.0018
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r--src/ex_cmds.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index ee9f1bca7..b462e1f6e 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -2026,6 +2026,8 @@ ex_file(eap)
* The name of the current buffer will be changed.
* A new (unlisted) buffer entry needs to be made to hold the old file
* name, which will become the alternate file name.
+ * But don't set the alternate file name if the buffer didn't have a
+ * name.
*/
fname = curbuf->b_ffname;
sfname = curbuf->b_sfname;
@@ -2039,9 +2041,12 @@ ex_file(eap)
return;
}
curbuf->b_flags |= BF_NOTEDITED;
- buf = buflist_new(fname, xfname, curwin->w_cursor.lnum, 0);
- if (buf != NULL && !cmdmod.keepalt)
- curwin->w_alt_fnum = buf->b_fnum;
+ if (xfname != NULL && *xfname != NUL)
+ {
+ buf = buflist_new(fname, xfname, curwin->w_cursor.lnum, 0);
+ if (buf != NULL && !cmdmod.keepalt)
+ curwin->w_alt_fnum = buf->b_fnum;
+ }
vim_free(fname);
vim_free(sfname);
#ifdef FEAT_AUTOCMD
@@ -2105,7 +2110,7 @@ do_write(eap)
#ifdef FEAT_BROWSE
if (cmdmod.browse)
{
- browse_file = do_browse(TRUE, (char_u *)_("Save As"), ffname,
+ browse_file = do_browse(BROWSE_SAVE, (char_u *)_("Save As"), ffname,
NULL, NULL, NULL, curbuf);
if (browse_file == NULL)
goto theend;
@@ -2609,7 +2614,7 @@ do_ecmd(fnum, ffname, sfname, eap, newlnum, flags)
#ifdef FEAT_BROWSE
if (cmdmod.browse)
{
- browse_file = do_browse(FALSE, (char_u *)_("Edit File"), ffname,
+ browse_file = do_browse(0, (char_u *)_("Edit File"), ffname,
NULL, NULL, NULL, curbuf);
if (browse_file == NULL)
goto theend;