0
0
mirror of https://github.com/vim/vim.git synced 2025-10-30 09:47:20 -04:00

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)
This commit is contained in:
Bram Moolenaar
2022-03-23 19:45:01 +00:00
parent c20e46a4e3
commit ac48506ac6
6 changed files with 27 additions and 10 deletions

View File

@@ -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()