Mercurial > vim
comparison src/option.c @ 20269:246101db63a4 v8.2.0690
patch 8.2.0690: line number of option set by modeline is wrong
Commit: https://github.com/vim/vim/commit/5125874951669944a5f6a4163d6e5d437ae6321e
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun May 3 17:19:33 2020 +0200
patch 8.2.0690: line number of option set by modeline is wrong
Problem: Line number of option set by modeline is wrong.
Solution: Do not double the line number. (Ozaki Kiichi, closes https://github.com/vim/vim/issues/6035)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 03 May 2020 17:30:03 +0200 |
parents | 918245588b50 |
children | c2570baa2e4c |
comparison
equal
deleted
inserted
replaced
20268:1a61225dc1d8 | 20269:246101db63a4 |
---|---|
2458 { | 2458 { |
2459 int both = (opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0; | 2459 int both = (opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0; |
2460 int indir = (int)options[opt_idx].indir; | 2460 int indir = (int)options[opt_idx].indir; |
2461 sctx_T new_script_ctx = script_ctx; | 2461 sctx_T new_script_ctx = script_ctx; |
2462 | 2462 |
2463 new_script_ctx.sc_lnum += SOURCING_LNUM; | 2463 // Modeline already has the line number set. |
2464 if (!(opt_flags & OPT_MODELINE)) | |
2465 new_script_ctx.sc_lnum += SOURCING_LNUM; | |
2464 | 2466 |
2465 // Remember where the option was set. For local options need to do that | 2467 // Remember where the option was set. For local options need to do that |
2466 // in the buffer or window structure. | 2468 // in the buffer or window structure. |
2467 if (both || (opt_flags & OPT_GLOBAL) || (indir & (PV_BUF|PV_WIN)) == 0) | 2469 if (both || (opt_flags & OPT_GLOBAL) || (indir & (PV_BUF|PV_WIN)) == 0) |
2468 options[opt_idx].script_ctx = new_script_ctx; | 2470 options[opt_idx].script_ctx = new_script_ctx; |