To: vim_dev@googlegroups.com Subject: Patch 8.2.1015 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1015 Problem: Popup filter gets key with modifier prepended when using modifyOtherKeys. Solution: Remove the shift modifier when it is included in the key, also when the Alt or Meta modifier is used. Files: src/term.c, src/misc2.c, src/testdir/test_popupwin.vim *** ../vim-8.2.1014/src/term.c 2020-06-14 16:43:43.428825203 +0200 --- src/term.c 2020-06-19 21:46:03.970493164 +0200 *************** *** 4772,4782 **** // Some keys already have Shift included, pass them as // normal keys. Not when Ctrl is also used, because // and are different. ! if (modifiers == MOD_MASK_SHIFT && ((key >= '@' && key <= 'Z') || key == '^' || key == '_' || (key >= '{' && key <= '~'))) ! modifiers = 0; // When used with Ctrl we always make a letter upper case, // so that mapping and are the same. Typing --- 4772,4785 ---- // Some keys already have Shift included, pass them as // normal keys. Not when Ctrl is also used, because // and are different. ! // Also for and . ! if ((modifiers == MOD_MASK_SHIFT ! || modifiers == (MOD_MASK_SHIFT | MOD_MASK_ALT) ! || modifiers == (MOD_MASK_SHIFT | MOD_MASK_META)) && ((key >= '@' && key <= 'Z') || key == '^' || key == '_' || (key >= '{' && key <= '~'))) ! modifiers &= ~MOD_MASK_SHIFT; // When used with Ctrl we always make a letter upper case, // so that mapping and are the same. Typing *** ../vim-8.2.1014/src/misc2.c 2020-06-07 20:49:02.073891895 +0200 --- src/misc2.c 2020-06-19 21:41:40.903642741 +0200 *************** *** 2929,2937 **** if ((modifiers & MOD_MASK_SHIFT) && ASCII_ISALPHA(key)) { key = TOUPPER_ASC(key); ! // With and we keep the shift modifier. ! // With and we don't keep the shift modifier. ! if (simplify || modifiers == MOD_MASK_SHIFT) modifiers &= ~MOD_MASK_SHIFT; } --- 2929,2939 ---- if ((modifiers & MOD_MASK_SHIFT) && ASCII_ISALPHA(key)) { key = TOUPPER_ASC(key); ! // With we keep the shift modifier. ! // With , and we don't keep the shift modifier. ! if (simplify || modifiers == MOD_MASK_SHIFT ! || modifiers == (MOD_MASK_SHIFT | MOD_MASK_ALT) ! || modifiers == (MOD_MASK_SHIFT | MOD_MASK_META)) modifiers &= ~MOD_MASK_SHIFT; } *** ../vim-8.2.1014/src/testdir/test_popupwin.vim 2020-06-15 21:19:04.017590497 +0200 --- src/testdir/test_popupwin.vim 2020-06-19 20:26:34.811362025 +0200 *************** *** 2079,2087 **** " check size with wrapping lines call term_sendkeys(buf, "j") call VerifyScreenDump(buf, 'Test_popupwin_scroll_12', {}) - call term_sendkeys(buf, "x") " clean up call StopVimInTerminal(buf) call delete('XtestPopupScroll') endfunc --- 2079,2087 ---- " check size with wrapping lines call term_sendkeys(buf, "j") call VerifyScreenDump(buf, 'Test_popupwin_scroll_12', {}) " clean up + call term_sendkeys(buf, "x") call StopVimInTerminal(buf) call delete('XtestPopupScroll') endfunc *************** *** 3347,3352 **** --- 3347,3358 ---- call feedkeys("\u301b", 'xt') call assert_equal([0xe3, 0x80, 0x9b], g:bytes) + if has('unix') + " with modifyOtherKeys does not include a modifier sequence + call feedkeys("\[27;4;65~", 'Lx!') + call assert_equal([0xc3, 0x81], g:bytes) + endif + call popup_clear() delfunc MyPopupFilter unlet g:bytes *** ../vim-8.2.1014/src/version.c 2020-06-19 19:30:50.177338803 +0200 --- src/version.c 2020-06-19 20:28:02.083137430 +0200 *************** *** 756,757 **** --- 756,759 ---- { /* Add new patch number below this line */ + /**/ + 1015, /**/ -- TIM: But follow only if you are men of valour. For the entrance to this cave is guarded by a monster, a creature so foul and cruel that no man yet has fought with it and lived. Bones of full fifty men lie strewn about its lair ... "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///