patch 8.2.4924: maparg() may return a string that cannot be reused
Problem: maparg() may return a string that cannot be reused.
Solution: use msg_outtrans_special() instead of str2special().
(closes #10384)
diff --git a/src/testdir/test_mapping.vim b/src/testdir/test_mapping.vim
index e886424..2b5613b 100644
--- a/src/testdir/test_mapping.vim
+++ b/src/testdir/test_mapping.vim
@@ -502,6 +502,13 @@
call assert_equal(['n <M-…> foo'],
\ execute('nmap <M-…>')->trim()->split("\n"))
+ " illegal bytes
+ let str = ":\x7f:\x80:\x90:\xd0:"
+ exe 'nmap foo ' .. str
+ call assert_equal(['n foo ' .. strtrans(str)],
+ \ execute('nmap foo')->trim()->split("\n"))
+ unlet str
+
" map to CTRL-V
exe "nmap ,k \<C-V>"
call assert_equal(['n ,k <Nop>'],