summaryrefslogtreecommitdiffstats
path: root/src/option.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-05-03 17:19:33 +0200
committerBram Moolenaar <Bram@vim.org>2020-05-03 17:19:33 +0200
commit5125874951669944a5f6a4163d6e5d437ae6321e (patch)
treeb1589f391fac9218027328452aa6582ba28bbea4 /src/option.c
parenta38b2b737e244eb2e4f199e070b05f86f4d433d4 (diff)
patch 8.2.0690: line number of option set by modeline is wrongv8.2.0690
Problem: Line number of option set by modeline is wrong. Solution: Do not double the line number. (Ozaki Kiichi, closes #6035)
Diffstat (limited to 'src/option.c')
-rw-r--r--src/option.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/option.c b/src/option.c
index 3f97c3cd15..8574f7f7cb 100644
--- a/src/option.c
+++ b/src/option.c
@@ -2460,7 +2460,9 @@ set_option_sctx_idx(int opt_idx, int opt_flags, sctx_T script_ctx)
int indir = (int)options[opt_idx].indir;
sctx_T new_script_ctx = script_ctx;
- new_script_ctx.sc_lnum += SOURCING_LNUM;
+ // Modeline already has the line number set.
+ if (!(opt_flags & OPT_MODELINE))
+ new_script_ctx.sc_lnum += SOURCING_LNUM;
// Remember where the option was set. For local options need to do that
// in the buffer or window structure.