Mercurial > vim
changeset 6531:005a6b650866 v7.4.592
updated for version 7.4.592
Problem: When doing ":e foobar" when already editing "foobar" and 'buftype'
is "nofile" the buffer is cleared. (Xavier de Gaye)
Solution: Do no clear the buffer.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Tue, 27 Jan 2015 11:26:15 +0100 |
parents | 435956324539 |
children | 357f273b9cbd |
files | src/ex_cmds.c src/version.c |
diffstat | 2 files changed, 9 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -3529,6 +3529,13 @@ do_ecmd(fnum, ffname, sfname, eap, newln #endif check_fname() == FAIL) goto theend; + + /* ":e foobar" when already editing "foobar" will reload the file. + * But when 'buftype' is "nofile" there is no file to load, so don't + * do anything. */ + if (curbuf->b_p_bt[0] == 'n' && curbuf->b_p_bt[2] == 'f') + goto theend; + oldbuf = (flags & ECMD_OLDBUF); }