diff options
Diffstat (limited to 'src/memline.c')
-rw-r--r-- | src/memline.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/memline.c b/src/memline.c index 469518d70c..1852682cb1 100644 --- a/src/memline.c +++ b/src/memline.c @@ -296,6 +296,10 @@ int ml_open(buf_T *buf) buf->b_ml.ml_line_lnum = 0; /* no cached line */ buf->b_ml.ml_chunksize = NULL; + if (cmdmod.noswapfile) { + buf->b_p_swf = FALSE; + } + /* * When 'updatecount' is non-zero swap file may be opened later. */ @@ -563,8 +567,9 @@ void ml_setname(buf_T *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) - ml_open_file(buf); /* create a swap file */ + if (p_uc != 0 && !cmdmod.noswapfile) { + ml_open_file(buf); /* create a swap file */ + } return; } @@ -652,8 +657,9 @@ void ml_open_file(buf_T *buf) char_u *dirp; mfp = buf->b_ml.ml_mfp; - if (mfp == NULL || mfp->mf_fd >= 0 || !buf->b_p_swf) - return; /* nothing to do */ + if (mfp == NULL || mfp->mf_fd >= 0 || !buf->b_p_swf || cmdmod.noswapfile) { + return; /* nothing to do */ + } /* For a spell buffer use a temp file name. */ if (buf->b_spell) { |