diff src/testdir/test_mapping.vim @ 28686:141fb1d233ba v8.2.4867

patch 8.2.4867: listing of mapping with K_SPECIAL is wrong Commit: https://github.com/vim/vim/commit/ac402f4d64bec6b6efd809fef52f5b34627bf947 Author: zeertzjq <zeertzjq@outlook.com> Date: Wed May 4 18:51:43 2022 +0100 patch 8.2.4867: listing of mapping with K_SPECIAL is wrong Problem: Listing of mapping with K_SPECIAL is wrong. Solution: Adjust escaping of special characters. (closes https://github.com/vim/vim/issues/10351)
author Bram Moolenaar <Bram@vim.org>
date Wed, 04 May 2022 20:00:03 +0200
parents 53c608c7ea9e
children fea88e555652
line wrap: on
line diff
--- a/src/testdir/test_mapping.vim
+++ b/src/testdir/test_mapping.vim
@@ -482,6 +482,26 @@ func Test_list_mappings()
   call assert_match("\tLast set from .*/test_mapping.vim line \\d\\+$",
         \ execute('verbose map ,n')->trim()->split("\n")[1])
 
+  " character with K_SPECIAL byte in rhs
+  nmap foo …
+  call assert_equal(['n  foo           …'],
+        \ execute('nmap foo')->trim()->split("\n"))
+
+  " modified character with K_SPECIAL byte in rhs
+  nmap foo <M-…>
+  call assert_equal(['n  foo           <M-…>'],
+        \ execute('nmap foo')->trim()->split("\n"))
+
+  " character with K_SPECIAL byte in lhs
+  nmap … foo
+  call assert_equal(['n  …             foo'],
+        \ execute('nmap …')->trim()->split("\n"))
+
+  " modified character with K_SPECIAL byte in lhs
+  nmap <M-…> foo
+  call assert_equal(['n  <M-…>         foo'],
+        \ execute('nmap <M-…>')->trim()->split("\n"))
+
   " map to CTRL-V
   exe "nmap ,k \<C-V>"
   call assert_equal(['n  ,k            <Nop>'],