diff options
author | Bram Moolenaar <Bram@vim.org> | 2014-03-23 16:04:02 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2014-03-23 16:04:02 +0100 |
commit | 5803ae6c076b1d61381afe27fcdedac61dd2cda9 (patch) | |
tree | d900239b97e5126bf6ae85fb0a9b05a531dcc7b8 /src/memline.c | |
parent | f7ff6e85e8a4e84cff023f5db4b66ef85986605a (diff) | |
download | vim-git-5803ae6c076b1d61381afe27fcdedac61dd2cda9.tar.gz |
updated for version 7.4.213v7.4.213
Problem: It's not possible to open a new buffer without creating a swap
file.
Solution: Add the ":noswapfile" modifier. (Christian Brabandt)
Diffstat (limited to 'src/memline.c')
-rw-r--r-- | src/memline.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/memline.c b/src/memline.c index 8f6c0e01e..fb438d273 100644 --- a/src/memline.c +++ b/src/memline.c @@ -289,6 +289,9 @@ ml_open(buf) buf->b_ml.ml_chunksize = NULL; #endif + if (cmdmod.noswapfile) + buf->b_p_swf = FALSE; + /* * When 'updatecount' is non-zero swap file may be opened later. */ @@ -606,7 +609,7 @@ ml_setname(buf) * When 'updatecount' is 0 and 'noswapfile' there is no swap file. * For help files we will make a swap file now. */ - if (p_uc != 0) + if (p_uc != 0 && !cmdmod.noswapfile) ml_open_file(buf); /* create a swap file */ return; } @@ -719,7 +722,7 @@ ml_open_file(buf) char_u *dirp; mfp = buf->b_ml.ml_mfp; - if (mfp == NULL || mfp->mf_fd >= 0 || !buf->b_p_swf) + if (mfp == NULL || mfp->mf_fd >= 0 || !buf->b_p_swf || cmdmod.noswapfile) return; /* nothing to do */ #ifdef FEAT_SPELL |