summaryrefslogtreecommitdiff
path: root/src/ex_cmds.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2015-01-27 11:26:15 +0100
committerBram Moolenaar <Bram@vim.org>2015-01-27 11:26:15 +0100
commitdf5caa08f62fe67f11e48771f4a5125ebc5a69b3 (patch)
treed514b891b05c330ef6c27cab1a1d39e814e67904 /src/ex_cmds.c
parent8a94d873aa8c753a8522ea86a049bdf2abd0c507 (diff)
downloadvim-df5caa08f62fe67f11e48771f4a5125ebc5a69b3.zip
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.
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r--src/ex_cmds.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 8195eb71b..e18a752cb 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -3529,6 +3529,13 @@ do_ecmd(fnum, ffname, sfname, eap, newlnum, flags, oldwin)
#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);
}