Patch 8.2.1496
Problem: Vim9: cannot use " #" in a mapping.
Solution: Do not remove a comment with the EX_NOTRLCOM flag. (closes #6746)
Files: src/ex_docmd.c, src/vim9compile.c, src/testdir/test_vim9_cmd.vim
*** ../vim-8.2.1495/src/ex_docmd.c 2020-08-20 15:24:56.482101905 +0200
--- src/ex_docmd.c 2020-08-20 17:46:00.885496936 +0200
***************
*** 4604,4609 ****
--- 4604,4610 ----
#ifdef FEAT_EVAL
|| (*p == '#'
&& in_vim9script()
+ && !(eap->argt & EX_NOTRLCOM)
&& p[1] != '{'
&& p > eap->cmd && VIM_ISWHITE(p[-1]))
#endif
*** ../vim-8.2.1495/src/vim9compile.c 2020-08-20 15:02:38.532535000 +0200
--- src/vim9compile.c 2020-08-20 18:00:40.192368600 +0200
***************
*** 6251,6256 ****
--- 6251,6257 ----
usefilter = TRUE;
if ((argt & EX_TRLBAR) && !usefilter)
{
+ eap->argt = argt;
separate_nextcmd(eap);
if (eap->nextcmd != NULL)
nextcmd = eap->nextcmd;
*** ../vim-8.2.1495/src/testdir/test_vim9_cmd.vim 2020-07-11 13:40:40.412931858 +0200
--- src/testdir/test_vim9_cmd.vim 2020-08-20 17:55:07.398994008 +0200
***************
*** 286,290 ****
--- 286,299 ----
unlet g:val
enddef
+ def Test_map_command()
+ let lines =<< trim END
+ nnoremap <F3> :echo 'hit F3 #'<CR>
+ assert_equal(":echo 'hit F3 #'<CR>", maparg("<F3>", "n"))
+ END
+ CheckDefSuccess(lines)
+ CheckScriptSuccess(['vim9script'] + lines)
+ enddef
+
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker
*** ../vim-8.2.1495/src/version.c 2020-08-20 16:16:23.762765214 +0200
--- src/version.c 2020-08-20 18:02:34.755642958 +0200
***************
*** 756,757 ****
--- 756,759 ----
{ /* Add new patch number below this line */
+ /**/
+ 1496,
/**/
--
hundred-and-one symptoms of being an internet addict:
251. You've never seen your closest friends who usually live WAY too far away.
/// Bram Moolenaar -- Br...@Moolenaar.net --
http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features --
http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language --
http://www.Zimbu.org ///
\\\ help me help AIDS victims --
http://ICCF-Holland.org ///