Problem: Vim9: wrong line number where options set
Solution: Set source line number earlier
closes: #13006
closes: #13013
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: LemonBoy <thatlemon@gmail.com>
set foldlevel&
enddef
+def Test_option_set_line_number()
+ var lines =<< trim END
+ vim9script
+ # line2
+ # line3
+ def F()
+ # line5
+ &foldlevel = -128
+ enddef
+ F()
+ END
+ v9.CheckScriptSuccess(lines)
+
+ var res = execute('verbose set foldlevel')
+ assert_match(' foldlevel.*Last set from .*XScriptSuccess\d\+ line 6', res)
+enddef
+
def Test_option_modifier()
# legacy script allows for white space
var lines =<< trim END
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1850,
/**/
1849,
/**/
char_u *tofree = NULL;
--ectx->ec_stack.ga_len;
+ SOURCING_LNUM = iptr->isn_lnum;
tv = STACK_TV_BOT(0);
if (tv->v_type == VAR_STRING)
{
}
else if (iptr->isn_type == ISN_STOREFUNCOPT)
{
- SOURCING_LNUM = iptr->isn_lnum;
// If the option can be set to a function reference or
// a lambda and the passed value is a function
// reference, then convert it to the name (string) of