diff options
Diffstat (limited to 'src/buffer.c')
-rw-r--r-- | src/buffer.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/buffer.c b/src/buffer.c index 2502dee62..dd3593fb5 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -5279,8 +5279,6 @@ chk_modeline( int vers; int end; int retval = OK; - char_u *save_sourcing_name; - linenr_T save_sourcing_lnum; #ifdef FEAT_EVAL sctx_T save_current_sctx; #endif @@ -5325,10 +5323,8 @@ chk_modeline( if (linecopy == NULL) return FAIL; - save_sourcing_lnum = sourcing_lnum; - save_sourcing_name = sourcing_name; - sourcing_lnum = lnum; // prepare for emsg() - sourcing_name = (char_u *)"modelines"; + // prepare for emsg() + estack_push(ETYPE_MODELINE, (char_u *)"modelines", lnum); end = FALSE; while (end == FALSE) @@ -5371,7 +5367,7 @@ chk_modeline( save_current_sctx = current_sctx; current_sctx.sc_sid = SID_MODELINE; current_sctx.sc_seq = 0; - current_sctx.sc_lnum = 0; + current_sctx.sc_lnum = lnum; current_sctx.sc_version = 1; #endif // Make sure no risky things are executed as a side effect. @@ -5389,9 +5385,7 @@ chk_modeline( s = e + 1; // advance to next part } - sourcing_lnum = save_sourcing_lnum; - sourcing_name = save_sourcing_name; - + estack_pop(); vim_free(linecopy); } return retval; |