comparison src/map.c @ 28590:86bf2dabc93a v8.2.4819

patch 8.2.4819: unmapping simplified keys also deletes other mapping Commit: https://github.com/vim/vim/commit/a4e3332650021921068ef12923b4501c5b9918cb Author: zeertzjq <zeertzjq@outlook.com> Date: Sun Apr 24 17:07:53 2022 +0100 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 https://github.com/vim/vim/issues/10270)
author Bram Moolenaar <Bram@vim.org>
date Sun, 24 Apr 2022 18:15:02 +0200
parents 6efa2f193c94
children d3c966c0cdf7
comparison
equal deleted inserted replaced
28589:4ebd60103d52 28590:86bf2dabc93a
723 || *skipwhite(keys + n) != NUL)) 723 || *skipwhite(keys + n) != NUL))
724 { 724 {
725 mpp = &(mp->m_next); 725 mpp = &(mp->m_next);
726 continue; 726 continue;
727 } 727 }
728 if (did_simplify && keyround == 1
729 && !mp->m_simplified)
730 break;
728 // We reset the indicated mode bits. If nothing 731 // We reset the indicated mode bits. If nothing
729 // is left the entry is deleted below. 732 // is left the entry is deleted below.
730 mp->m_mode &= ~mode; 733 mp->m_mode &= ~mode;
731 did_it = TRUE; // remember we did something 734 did_it = TRUE; // remember we did something
732 } 735 }
812 815
813 if (maptype == 1) 816 if (maptype == 1)
814 { 817 {
815 // delete entry 818 // delete entry
816 if (!did_it) 819 if (!did_it)
817 retval = 2; // no match 820 {
821 if (!did_simplify || keyround == 2)
822 retval = 2; // no match
823 }
818 else if (*keys == Ctrl_C) 824 else if (*keys == Ctrl_C)
819 { 825 {
820 // If CTRL-C has been unmapped, reuse it for Interrupting. 826 // If CTRL-C has been unmapped, reuse it for Interrupting.
821 if (map_table == curbuf->b_maphash) 827 if (map_table == curbuf->b_maphash)
822 curbuf->b_mapped_ctrl_c &= ~mode; 828 curbuf->b_mapped_ctrl_c &= ~mode;