To: vim_dev@googlegroups.com Subject: Patch 9.0.0957 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0957 Problem: Tests fail without the terminal feature. Solution: Move functions to another utility script. Files: src/testdir/term_util.vim, src/testdir/view_util.vim *** ../vim-9.0.0956/src/testdir/term_util.vim 2022-11-27 12:45:37.311707363 +0000 --- src/testdir/term_util.vim 2022-11-27 13:47:38.521028984 +0000 *************** *** 189,231 **** return join(map(a:lines, 'term_getline(a:buf, v:val)'), '') endfunc - " When using RunVimInTerminal() we expect modifyOtherKeys level 2 to be enabled - " automatically. The key + modifier Escape codes must then use the - " modifyOtherKeys encoding. They are recognized anyway, thus it's safer to use - " than the raw code. - - " Return the modifyOtherKeys level 2 encoding for "key" with "modifier" - " (number value, e.g. CTRL is 5). - func GetEscCodeCSI27(key, modifier) - let key = printf("%d", char2nr(a:key)) - let mod = printf("%d", a:modifier) - return "\[27;" .. mod .. ';' .. key .. '~' - endfunc - - " Return the modifyOtherKeys level 2 encoding for "key" with "modifier" - " (character value, e.g. CTRL is "C"). - func GetEscCodeWithModifier(modifier, key) - let modifier = get({'C': 5}, a:modifier, '') - if modifier == '' - echoerr 'Unknown modifier: ' .. a:modifier - endif - return GetEscCodeCSI27(a:key, modifier) - endfunc - - " Return the kitty keyboard protocol encoding for "key" with "modifier" - " (number value, e.g. CTRL is 5). - func GetEscCodeCSIu(key, modifier) - let key = printf("%d", char2nr(a:key)) - let mod = printf("%d", a:modifier) - return "\[" .. key .. ';' .. mod .. 'u' - endfunc - - " Return the kitty keyboard protocol encoding for "key" without a modifier. - " Used for the Escape key. - func GetEscCodeCSIuWithoutModifier(key) - let key = printf("%d", char2nr(a:key)) - return "\[" .. key .. 'u' - endfunc - " vim: shiftwidth=2 sts=2 expandtab --- 189,193 ---- *** ../vim-9.0.0956/src/testdir/view_util.vim 2022-10-06 19:49:09.561466199 +0100 --- src/testdir/view_util.vim 2022-11-27 13:47:45.185026499 +0000 *************** *** 62,64 **** --- 62,104 ---- bw! redraw! endfunc + + + " When using RunVimInTerminal() we expect modifyOtherKeys level 2 to be enabled + " automatically. The key + modifier Escape codes must then use the + " modifyOtherKeys encoding. They are recognized anyway, thus it's safer to use + " than the raw code. + + " Return the modifyOtherKeys level 2 encoding for "key" with "modifier" + " (number value, e.g. CTRL is 5). + func GetEscCodeCSI27(key, modifier) + let key = printf("%d", char2nr(a:key)) + let mod = printf("%d", a:modifier) + return "\[27;" .. mod .. ';' .. key .. '~' + endfunc + + " Return the modifyOtherKeys level 2 encoding for "key" with "modifier" + " (character value, e.g. CTRL is "C"). + func GetEscCodeWithModifier(modifier, key) + let modifier = get({'C': 5}, a:modifier, '') + if modifier == '' + echoerr 'Unknown modifier: ' .. a:modifier + endif + return GetEscCodeCSI27(a:key, modifier) + endfunc + + " Return the kitty keyboard protocol encoding for "key" with "modifier" + " (number value, e.g. CTRL is 5). + func GetEscCodeCSIu(key, modifier) + let key = printf("%d", char2nr(a:key)) + let mod = printf("%d", a:modifier) + return "\[" .. key .. ';' .. mod .. 'u' + endfunc + + " Return the kitty keyboard protocol encoding for "key" without a modifier. + " Used for the Escape key. + func GetEscCodeCSIuWithoutModifier(key) + let key = printf("%d", char2nr(a:key)) + return "\[" .. key .. 'u' + endfunc + *** ../vim-9.0.0956/src/version.c 2022-11-27 12:45:37.311707363 +0000 --- src/version.c 2022-11-27 13:50:35.194101896 +0000 *************** *** 697,698 **** --- 697,700 ---- { /* Add new patch number below this line */ + /**/ + 957, /**/ -- hundred-and-one symptoms of being an internet addict: 157. You fum through a magazine, you first check to see if it has a web address. /// 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 ///