diff options
author | Bram Moolenaar <bram@vim.org> | 2015-01-27 11:26:15 +0100 |
---|---|---|
committer | Bram Moolenaar <bram@vim.org> | 2015-01-27 11:26:15 +0100 |
commit | 4b34f54b71060d110aca483439e5fdb889a3cbc7 (patch) | |
tree | f6a4522d3d96e536c17b8fed2727043fb7b6bdc2 | |
parent | 1d70f4dcde7b388052425660b44cfbe10eaac90b (diff) | |
download | vim-4b34f54b71060d110aca483439e5fdb889a3cbc7.tar.gz |
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.
-rw-r--r-- | src/ex_cmds.c | 7 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c index 8195eb71..e18a752c 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); } diff --git a/src/version.c b/src/version.c index 33f8a972..abf41a66 100644 --- a/src/version.c +++ b/src/version.c @@ -742,6 +742,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 592, +/**/ 591, /**/ 590, |