Mercurial > vim
comparison src/ex_cmds.c @ 29:ac33b7c03fac v7.0018
updated for version 7.0018
author | vimboss |
---|---|
date | Mon, 11 Oct 2004 10:16:09 +0000 |
parents | 3f44e9abe4ec |
children | 7f788cd27415 |
comparison
equal
deleted
inserted
replaced
28:726bdc53fa49 | 29:ac33b7c03fac |
---|---|
2024 #endif | 2024 #endif |
2025 /* | 2025 /* |
2026 * The name of the current buffer will be changed. | 2026 * The name of the current buffer will be changed. |
2027 * A new (unlisted) buffer entry needs to be made to hold the old file | 2027 * A new (unlisted) buffer entry needs to be made to hold the old file |
2028 * name, which will become the alternate file name. | 2028 * name, which will become the alternate file name. |
2029 * But don't set the alternate file name if the buffer didn't have a | |
2030 * name. | |
2029 */ | 2031 */ |
2030 fname = curbuf->b_ffname; | 2032 fname = curbuf->b_ffname; |
2031 sfname = curbuf->b_sfname; | 2033 sfname = curbuf->b_sfname; |
2032 xfname = curbuf->b_fname; | 2034 xfname = curbuf->b_fname; |
2033 curbuf->b_ffname = NULL; | 2035 curbuf->b_ffname = NULL; |
2037 curbuf->b_ffname = fname; | 2039 curbuf->b_ffname = fname; |
2038 curbuf->b_sfname = sfname; | 2040 curbuf->b_sfname = sfname; |
2039 return; | 2041 return; |
2040 } | 2042 } |
2041 curbuf->b_flags |= BF_NOTEDITED; | 2043 curbuf->b_flags |= BF_NOTEDITED; |
2042 buf = buflist_new(fname, xfname, curwin->w_cursor.lnum, 0); | 2044 if (xfname != NULL && *xfname != NUL) |
2043 if (buf != NULL && !cmdmod.keepalt) | 2045 { |
2044 curwin->w_alt_fnum = buf->b_fnum; | 2046 buf = buflist_new(fname, xfname, curwin->w_cursor.lnum, 0); |
2047 if (buf != NULL && !cmdmod.keepalt) | |
2048 curwin->w_alt_fnum = buf->b_fnum; | |
2049 } | |
2045 vim_free(fname); | 2050 vim_free(fname); |
2046 vim_free(sfname); | 2051 vim_free(sfname); |
2047 #ifdef FEAT_AUTOCMD | 2052 #ifdef FEAT_AUTOCMD |
2048 apply_autocmds(EVENT_BUFFILEPOST, NULL, NULL, FALSE, curbuf); | 2053 apply_autocmds(EVENT_BUFFILEPOST, NULL, NULL, FALSE, curbuf); |
2049 #endif | 2054 #endif |
2103 | 2108 |
2104 ffname = eap->arg; | 2109 ffname = eap->arg; |
2105 #ifdef FEAT_BROWSE | 2110 #ifdef FEAT_BROWSE |
2106 if (cmdmod.browse) | 2111 if (cmdmod.browse) |
2107 { | 2112 { |
2108 browse_file = do_browse(TRUE, (char_u *)_("Save As"), ffname, | 2113 browse_file = do_browse(BROWSE_SAVE, (char_u *)_("Save As"), ffname, |
2109 NULL, NULL, NULL, curbuf); | 2114 NULL, NULL, NULL, curbuf); |
2110 if (browse_file == NULL) | 2115 if (browse_file == NULL) |
2111 goto theend; | 2116 goto theend; |
2112 ffname = browse_file; | 2117 ffname = browse_file; |
2113 } | 2118 } |
2607 else | 2612 else |
2608 { | 2613 { |
2609 #ifdef FEAT_BROWSE | 2614 #ifdef FEAT_BROWSE |
2610 if (cmdmod.browse) | 2615 if (cmdmod.browse) |
2611 { | 2616 { |
2612 browse_file = do_browse(FALSE, (char_u *)_("Edit File"), ffname, | 2617 browse_file = do_browse(0, (char_u *)_("Edit File"), ffname, |
2613 NULL, NULL, NULL, curbuf); | 2618 NULL, NULL, NULL, curbuf); |
2614 if (browse_file == NULL) | 2619 if (browse_file == NULL) |
2615 goto theend; | 2620 goto theend; |
2616 ffname = browse_file; | 2621 ffname = browse_file; |
2617 } | 2622 } |