]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.0957: tests fail without the terminal feature v9.0.0957
authorBram Moolenaar <Bram@vim.org>
Sun, 27 Nov 2022 13:51:22 +0000 (13:51 +0000)
committerBram Moolenaar <Bram@vim.org>
Sun, 27 Nov 2022 13:51:22 +0000 (13:51 +0000)
Problem:    Tests fail without the terminal feature.
Solution:   Move functions to another utility script.

src/testdir/term_util.vim
src/testdir/view_util.vim
src/version.c

index dac5a72744bc6c17ed215710e9d594456286e5bd..98c9cfb40b18fef36c9c4433268faa99d1ca0dac 100644 (file)
@@ -189,43 +189,5 @@ func Term_getlines(buf, lines)
   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 "\<Esc>[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 "\<Esc>[" .. 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 "\<Esc>[" .. key .. 'u'
-endfunc
-
 
 " vim: shiftwidth=2 sts=2 expandtab
index a4d0e56af9007ce623a00859875bbde8c63d5c1e..a0c1781dd445f7beba80b0889a125e5cbecefa74 100644 (file)
@@ -62,3 +62,43 @@ func CloseWindow() abort
   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 "\<Esc>[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 "\<Esc>[" .. 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 "\<Esc>[" .. key .. 'u'
+endfunc
+
index a00a989fc607ae5d8decbe5b97f8c6f7c79ecc0b..5d6a2a42d3b85b1f80b46ecfb72feeca6e70f4b3 100644 (file)
@@ -695,6 +695,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    957,
 /**/
     956,
 /**/