From c3634a02613459c85c228c400513835361ecc44a Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 31 Mar 2022 21:06:34 +0800 Subject: vim-patch:8.1.2159: some mappings are listed twice Problem: Some mappings are listed twice. Solution: Skip mappings duplicated for modifyOtherKeys. (closes vim/vim#5064) https://github.com/vim/vim/commit/fafb4b18cd4aa5897537f53003b31bb83d7362df --- src/nvim/testdir/test_mapping.vim | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/nvim/testdir/test_mapping.vim') diff --git a/src/nvim/testdir/test_mapping.vim b/src/nvim/testdir/test_mapping.vim index a9500f8f77..c46336460d 100644 --- a/src/nvim/testdir/test_mapping.vim +++ b/src/nvim/testdir/test_mapping.vim @@ -429,6 +429,22 @@ func Test_error_in_map_expr() exe buf .. 'bwipe!' endfunc +func Test_list_mappings() + inoremap CtrlM + inoremap AltS + inoremap ShiftSlash + call assert_equal([ + \ 'i * ShiftSlash', + \ 'i * AltS', + \ 'i * CtrlM', + \], execute('imap')->trim()->split("\n")) + iunmap + iunmap + call assert_equal(['i * ShiftSlash'], execute('imap')->trim()->split("\n")) + iunmap + call assert_equal(['No mapping found'], execute('imap')->trim()->split("\n")) +endfunc + func Test_expr_map_gets_cursor() new call setline(1, ['one', 'some w!rd']) -- cgit From b5837e55e69602ce9716c8c04b1e2cb3188be8a5 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 25 Apr 2022 14:38:28 +0800 Subject: vim-patch:8.1.2165: mapping test fails on Mac Problem: Mapping test fails on Mac. Solution: Remove the default Mac mapping. https://github.com/vim/vim/commit/4f2f61a014e80217a2d6ac476c8f94e250a3d0ff --- src/nvim/testdir/test_mapping.vim | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/nvim/testdir/test_mapping.vim') diff --git a/src/nvim/testdir/test_mapping.vim b/src/nvim/testdir/test_mapping.vim index c46336460d..604ae8a3f9 100644 --- a/src/nvim/testdir/test_mapping.vim +++ b/src/nvim/testdir/test_mapping.vim @@ -430,6 +430,9 @@ func Test_error_in_map_expr() endfunc func Test_list_mappings() + " Remove default Mac mapping + silent! iunmap + inoremap CtrlM inoremap AltS inoremap ShiftSlash -- cgit From 44269c73a32f13d39ead1fdc257a97fc18ae805c Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 25 Apr 2022 14:38:39 +0800 Subject: vim-patch:8.1.2167: mapping test fails on MS-Windows Problem: Mapping test fails on MS-Windows. Solution: Remove all the existing Insert-mode mappings. https://github.com/vim/vim/commit/2559a47823a6a7827631f2e6a0176d7afce2721c --- src/nvim/testdir/test_mapping.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/testdir/test_mapping.vim') diff --git a/src/nvim/testdir/test_mapping.vim b/src/nvim/testdir/test_mapping.vim index 604ae8a3f9..b1c2429511 100644 --- a/src/nvim/testdir/test_mapping.vim +++ b/src/nvim/testdir/test_mapping.vim @@ -430,8 +430,8 @@ func Test_error_in_map_expr() endfunc func Test_list_mappings() - " Remove default Mac mapping - silent! iunmap + " Remove default mappings + imapclear inoremap CtrlM inoremap AltS -- cgit From abe91e1efec84c47c03a69ab8a998bb16f628084 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 26 Apr 2022 15:05:56 +0800 Subject: vim-patch:8.2.0855: GUI tests fail because the test doesn't use a modifier Problem: GUI tests fail because the test doesn't use a modifier. Solution: Add "\{xxx}" to be able to encode a modifier. https://github.com/vim/vim/commit/ebe9d34aa07037cff2188a8dd424ee1f59cbb0bf Change macros to enums to use them in unit tests. --- src/nvim/testdir/test_mapping.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/nvim/testdir/test_mapping.vim') diff --git a/src/nvim/testdir/test_mapping.vim b/src/nvim/testdir/test_mapping.vim index b1c2429511..c6f052ab44 100644 --- a/src/nvim/testdir/test_mapping.vim +++ b/src/nvim/testdir/test_mapping.vim @@ -62,7 +62,7 @@ func Test_map_ctrl_c_insert() inoremap cnoremap dummy cunmap - call feedkeys("GoTEST2: CTRL-C |\A|\", "xt") + call feedkeys("GoTEST2: CTRL-C |\{C-C}A|\", "xt") call assert_equal('TEST2: CTRL-C |A|', getline('$')) unmap! set nomodified @@ -71,7 +71,7 @@ endfunc func Test_map_ctrl_c_visual() " mapping of ctrl-c in Visual mode vnoremap :$put ='vmap works' - call feedkeys("GV\\", "xt") + call feedkeys("GV\{C-C}\", "xt") call assert_equal('vmap works', getline('$')) vunmap set nomodified @@ -221,7 +221,7 @@ endfunc func Test_map_meta_quotes() imap foo - call feedkeys("Go-\-\", "xt") + call feedkeys("Go-\{M-\"}-\", "xt") call assert_equal("-foo-", getline('$')) set nomodified iunmap -- cgit From d531ef6813919dd6df8ca6927cd99ec3c0a65635 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 26 Apr 2022 15:31:29 +0800 Subject: vim-patch:8.2.0867: using \{xxx} for encoding a modifier is not nice Problem: Using \{xxx} for encoding a modifier is not nice. Solution: Use \<*xxx> instead, since it's the same as \ but producing a different code. https://github.com/vim/vim/commit/fccd93f0917234b962ce07d1df3adf9d7105936f Use this notation in langmap_spec. --- src/nvim/testdir/test_mapping.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/nvim/testdir/test_mapping.vim') diff --git a/src/nvim/testdir/test_mapping.vim b/src/nvim/testdir/test_mapping.vim index c6f052ab44..f03d157fac 100644 --- a/src/nvim/testdir/test_mapping.vim +++ b/src/nvim/testdir/test_mapping.vim @@ -62,7 +62,7 @@ func Test_map_ctrl_c_insert() inoremap cnoremap dummy cunmap - call feedkeys("GoTEST2: CTRL-C |\{C-C}A|\", "xt") + call feedkeys("GoTEST2: CTRL-C |\<*C-C>A|\", "xt") call assert_equal('TEST2: CTRL-C |A|', getline('$')) unmap! set nomodified @@ -71,7 +71,7 @@ endfunc func Test_map_ctrl_c_visual() " mapping of ctrl-c in Visual mode vnoremap :$put ='vmap works' - call feedkeys("GV\{C-C}\", "xt") + call feedkeys("GV\<*C-C>\", "xt") call assert_equal('vmap works', getline('$')) vunmap set nomodified @@ -221,7 +221,7 @@ endfunc func Test_map_meta_quotes() imap foo - call feedkeys("Go-\{M-\"}-\", "xt") + call feedkeys("Go-\<*M-\">-\", "xt") call assert_equal("-foo-", getline('$')) set nomodified iunmap -- cgit From 4531ddaa62c0958262b6983b04d72531abe8b337 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 27 Apr 2022 12:31:24 +0800 Subject: vim-patch:8.2.2728: special key names don't work if 'isident' is cleared Problem: Special key names don't work if 'isident' is cleared. Solution: Add vim_isNormalIDc() and use it for special key names. (closes vim/vim#2389) https://github.com/vim/vim/commit/e3d1f4c982bd0fe05496448d7868268c75ff7bfb Code is N/A as Nvim already has ascii_isident(), so just port the test. --- src/nvim/testdir/test_mapping.vim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/nvim/testdir/test_mapping.vim') diff --git a/src/nvim/testdir/test_mapping.vim b/src/nvim/testdir/test_mapping.vim index f03d157fac..8c399ff3b1 100644 --- a/src/nvim/testdir/test_mapping.vim +++ b/src/nvim/testdir/test_mapping.vim @@ -433,9 +433,12 @@ func Test_list_mappings() " Remove default mappings imapclear - inoremap CtrlM + " reset 'isident' to check it isn't used + set isident= + inoremap CtrlM inoremap AltS inoremap ShiftSlash + set isident& call assert_equal([ \ 'i * ShiftSlash', \ 'i * AltS', -- cgit From c14d89f306e8ca49758f49f0e48aa3ce88130ac4 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 27 Apr 2022 20:21:04 +0800 Subject: vim-patch:8.2.4819: unmapping simplified keys also deletes other mapping Problem: Unmapping simplified keys also deletes other mapping. Solution: Only unmap a mapping with m_simplified set. (closes vim/vim#10270) https://github.com/vim/vim/commit/a4e3332650021921068ef12923b4501c5b9918cb --- src/nvim/testdir/test_mapping.vim | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/nvim/testdir/test_mapping.vim') diff --git a/src/nvim/testdir/test_mapping.vim b/src/nvim/testdir/test_mapping.vim index 8c399ff3b1..88735a34b8 100644 --- a/src/nvim/testdir/test_mapping.vim +++ b/src/nvim/testdir/test_mapping.vim @@ -761,4 +761,15 @@ func Test_mouse_drag_insert_map() set mouse& endfunc +func Test_unmap_simplfied() + map foo + map bar + call assert_equal('foo', maparg('')) + call assert_equal('bar', maparg('')) + unmap + call assert_equal('', maparg('')) + call assert_equal('bar', maparg('')) + unmap +endfunc + " vim: shiftwidth=2 sts=2 expandtab -- cgit From f2b512ad75cace9126eb0ea644daedd758c238e6 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 27 Apr 2022 20:27:38 +0800 Subject: vim-patch:8.2.4828: fix for unmapping simplified key not fully tested Problem: Fix for unmapping simplified key not fully tested. Solution: Add a test case. (closes vim/vim#10292) https://github.com/vim/vim/commit/abeb09b2c53054513812d1e56716e2a5abe8f354 --- src/nvim/testdir/test_mapping.vim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/nvim/testdir/test_mapping.vim') diff --git a/src/nvim/testdir/test_mapping.vim b/src/nvim/testdir/test_mapping.vim index 88735a34b8..6bb8d82021 100644 --- a/src/nvim/testdir/test_mapping.vim +++ b/src/nvim/testdir/test_mapping.vim @@ -761,7 +761,7 @@ func Test_mouse_drag_insert_map() set mouse& endfunc -func Test_unmap_simplfied() +func Test_unmap_simplifiable() map foo map bar call assert_equal('foo', maparg('')) @@ -770,6 +770,11 @@ func Test_unmap_simplfied() call assert_equal('', maparg('')) call assert_equal('bar', maparg('')) unmap + + map foo + unmap + " This should not error + unmap endfunc " vim: shiftwidth=2 sts=2 expandtab -- cgit