diff options
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r-- | src/nvim/buffer.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index c8ed7d0b37..cdb226b94d 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -5112,14 +5112,15 @@ chk_modeline( *e = NUL; // truncate the set command if (*s != NUL) { // skip over an empty "::" + const int secure_save = secure; save_SID = current_SID; current_SID = SID_MODELINE; // Make sure no risky things are executed as a side effect. - secure++; + secure = 1; retval = do_set(s, OPT_MODELINE | OPT_LOCAL | flags); - secure--; + secure = secure_save; current_SID = save_SID; if (retval == FAIL) { // stop if error found break; |