Patch 8.2.3021

2 views
Skip to first unread message

Bram Moolenaar

unread,
Jun 20, 2021, 6:40:33 AM6/20/21
to vim...@googlegroups.com

Patch 8.2.3021
Problem: Spaces allowed between option name and "!", "?", etc.
Solution: Disallow spaces in Vim9 script, it was not documented.
(closes #8408)
Files: src/option.c, src/testdir/test_vim9_script.vim


*** ../vim-8.2.3020/src/option.c 2021-06-13 20:27:32.889357660 +0200

--- src/option.c 2021-06-20 12:35:10.403855328 +0200
***************
*** 1306,1314 ****
// remember character after option name
afterchar = arg[len];

! // skip white space, allow ":set ai ?"
! while (VIM_ISWHITE(arg[len]))
! ++len;

adding = FALSE;
prepending = FALSE;
--- 1306,1315 ----
// remember character after option name
afterchar = arg[len];

! if (!in_vim9script())
! // skip white space, allow ":set ai ?", ":set hlsearch !"
! while (VIM_ISWHITE(arg[len]))
! ++len;

adding = FALSE;
prepending = FALSE;
*** ../vim-8.2.3020/src/testdir/test_vim9_script.vim 2021-06-17 22:08:13.376738576 +0200
--- src/testdir/test_vim9_script.vim 2021-06-20 12:38:40.823105963 +0200
***************
*** 3937,3942 ****
--- 3937,3962 ----
delfunc g:FuncA
enddef

+ def Test_option_modifier()
+ var lines =<< trim END
+ set hlsearch & hlsearch !
+ call assert_equal(1, &hlsearch)
+ END
+ CheckScriptSuccess(lines)
+
+ lines =<< trim END
+ vim9script
+ set hlsearch &
+ END
+ CheckScriptFailure(lines, 'E518:')
+
+ lines =<< trim END
+ vim9script
+ set hlsearch & hlsearch !
+ END
+ CheckScriptFailure(lines, 'E518:')
+ enddef
+
" Keep this last, it messes up highlighting.
def Test_substitute_cmd()
new
*** ../vim-8.2.3020/src/version.c 2021-06-19 21:38:21.728726296 +0200
--- src/version.c 2021-06-20 12:29:04.341266041 +0200
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 3021,
/**/

--
hundred-and-one symptoms of being an internet addict:
23. You can't call your mother... she doesn't have VOIP

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages