vim-patch:8.2.1898: command modifier parsing always uses global cmdmod

Problem:    Command modifier parsing always uses global cmdmod.
Solution:   Pass in cmdmod_T to use.  Rename struct fields consistently.
e100440158
This commit is contained in:
zeertzjq
2022-06-13 20:20:34 +08:00
parent dad898b665
commit 6130b4a84b
23 changed files with 294 additions and 291 deletions

View File

@@ -264,7 +264,7 @@ int ml_open(buf_T *buf)
buf->b_ml.ml_chunksize = NULL;
buf->b_ml.ml_usedchunks = 0;
if (cmdmod.noswapfile) {
if (cmdmod.cmod_flags & CMOD_NOSWAPFILE) {
buf->b_p_swf = false;
}
@@ -391,7 +391,7 @@ 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 && !cmdmod.noswapfile) {
if (p_uc != 0 && (cmdmod.cmod_flags & CMOD_NOSWAPFILE) == 0) {
ml_open_file(buf); // create a swap file
}
return;
@@ -475,7 +475,8 @@ 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 || cmdmod.noswapfile
if (mfp == NULL || mfp->mf_fd >= 0 || !buf->b_p_swf
|| (cmdmod.cmod_flags & CMOD_NOSWAPFILE)
|| buf->terminal) {
return; // nothing to do
}