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 <C-I> foo
+ map <Tab> bar
+ call assert_equal('foo', maparg('<C-I>'))
+ call assert_equal('bar', maparg('<Tab>'))
+ unmap <C-I>
+ call assert_equal('', maparg('<C-I>'))
+ call assert_equal('bar', maparg('<Tab>'))
+ unmap <Tab>
+ 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 -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20220424160918.594121C43E7%40moolenaar.net.