# HG changeset patch # User Bram Moolenaar # Date 1650972604 -7200 # Node ID 9ae7ccd900414547b5aac4ac213340e944273908 # Parent 039d9e2fbb46bf86abd78b2bb402d13cc9b0ee2d patch 8.2.4828: fix for unmapping simplified key not fully tested Commit: https://github.com/vim/vim/commit/abeb09b2c53054513812d1e56716e2a5abe8f354 Author: zeertzjq Date: Tue Apr 26 12:29:43 2022 +0100 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 https://github.com/vim/vim/issues/10292) diff --git a/src/map.c b/src/map.c --- 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 --- 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 --- a/src/version.c +++ b/src/version.c @@ -747,6 +747,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 4828, +/**/ 4827, /**/ 4826,