From abeb09b2c53054513812d1e56716e2a5abe8f354 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 26 Apr 2022 12:29:43 +0100 Subject: [PATCH] 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 #10292) --- src/map.c | 2 ++ src/testdir/test_mapping.vim | 7 ++++++- src/version.c | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/map.c b/src/map.c index ea7567e8d..186550a1f 100644 --- a/src/map.c +++ b/src/map.c @@ -726,6 +726,8 @@ do_map( mpp = &(mp->m_next); continue; } + // In keyround for simplified keys, don't unmap + // a mapping without m_simplified flag. if (keyround1_simplified && !mp->m_simplified) break; // We reset the indicated mode bits. If nothing diff --git a/src/testdir/test_mapping.vim b/src/testdir/test_mapping.vim index e0008d62a..b413f4fc3 100644 --- a/src/testdir/test_mapping.vim +++ b/src/testdir/test_mapping.vim @@ -1627,7 +1627,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('')) @@ -1636,6 +1636,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 diff --git a/src/version.c b/src/version.c index 2998d2d36..945b6a18a 100644 --- a/src/version.c +++ b/src/version.c @@ -746,6 +746,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 4828, /**/ 4827, /**/ -- 2.40.0