Mercurial > vim
diff src/testdir/test_vim9_cmd.vim @ 28179:49631bf057d3 v8.2.4615
patch 8.2.4615: mapping with escaped bar does not work in :def function
Commit: https://github.com/vim/vim/commit/ac48506ac62b2ece523d5af6ea6c95b699d70b94
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Mar 23 19:45:01 2022 +0000
patch 8.2.4615: mapping with escaped bar does not work in :def function
Problem: Mapping with escaped bar does not work in :def function. (Sergey
Vlasov)
Solution: Do not remove the backslash. (closes #10002)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 23 Mar 2022 21:00:05 +0100 |
parents | ae975c8d5438 |
children | bd1dcc605e58 |
line wrap: on
line diff
--- a/src/testdir/test_vim9_cmd.vim +++ b/src/testdir/test_vim9_cmd.vim @@ -1178,8 +1178,19 @@ def Test_map_command() nnoremap <F3> :echo 'hit F3 #'<CR> assert_equal(":echo 'hit F3 #'<CR>", maparg("<F3>", "n")) END - v9.CheckDefSuccess(lines) - v9.CheckScriptSuccess(['vim9script'] + lines) + v9.CheckDefAndScriptSuccess(lines) + + # backslash before bar is not removed + lines =<< trim END + vim9script + + def Init() + noremap <buffer> <F5> <ScriptCmd>MyFunc('a') \| MyFunc('b')<CR> + enddef + Init() + unmap <buffer> <F5> + END + v9.CheckScriptSuccess(lines) enddef def Test_normal_command()