To: vim_dev@googlegroups.com Subject: Patch 8.2.4819 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.4819 Problem: Unmapping simplified keys also deletes other mapping. Solution: Only unmap a mapping with m_simplified set. (closes #10270) Files: src/map.c, src/testdir/test_mapping.vim *** ../vim-8.2.4818/src/map.c 2022-02-28 13:28:34.544563774 +0000 --- src/map.c 2022-04-24 17:02:11.305139709 +0100 *************** *** 725,730 **** --- 725,733 ---- mpp = &(mp->m_next); continue; } + if (did_simplify && keyround == 1 + && !mp->m_simplified) + break; // We reset the indicated mode bits. If nothing // is left the entry is deleted below. mp->m_mode &= ~mode; *************** *** 814,820 **** { // delete entry if (!did_it) ! retval = 2; // no match else if (*keys == Ctrl_C) { // If CTRL-C has been unmapped, reuse it for Interrupting. --- 817,826 ---- { // delete entry if (!did_it) ! { ! if (!did_simplify || keyround == 2) ! retval = 2; // no match ! } else if (*keys == Ctrl_C) { // If CTRL-C has been unmapped, reuse it for Interrupting. *** ../vim-8.2.4818/src/testdir/test_mapping.vim 2022-04-24 15:58:12.603890236 +0100 --- src/testdir/test_mapping.vim 2022-04-24 16:46:28.297641911 +0100 *************** *** 1627,1630 **** --- 1627,1641 ---- 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 *** ../vim-8.2.4818/src/version.c 2022-04-24 15:58:12.607890232 +0100 --- src/version.c 2022-04-24 16:47:58.101632092 +0100 *************** *** 748,749 **** --- 748,751 ---- { /* Add new patch number below this line */ + /**/ + 4819, /**/ -- Microsoft is to software what McDonalds is to gourmet cooking /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///