From a2834e17d18a3e7211da6f792cc6d86dac5e8c3b Mon Sep 17 00:00:00 2001 From: Christian Fillion Date: Wed, 16 Oct 2024 17:28:38 +0200 Subject: [PATCH 1/5] patch 9.1.0788: 27;u is not decoded to literal Escape in kitty/foot Problem: 27;u is not decoded to literal Escape in kitty/foot Solution: disable XTerm modifyOtherKeys form 1 when the kitty protocol is enabled (Christian Fillion) References: - https://invisible-island.net/xterm/modified-keys.html - https://sw.kovidgoyal.net/kitty/keyboard-protocol/ - https://codeberg.org/dnkl/foot/src/commit/e891abdd6a6652bd46b28c1988700a7f30931210/kitty-keymap.h - https://github.com/kovidgoyal/kitty/blob/d31459b0926f2afddc317d76314e4afd0d07d473/kitty/key_encoding.c#L193 fixes: #15868 closes: #15881 Signed-off-by: Christian Fillion Signed-off-by: Christian Brabandt --- src/edit.c | 8 +++++--- src/testdir/test_termcodes.vim | 6 ++++++ src/version.c | 2 ++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/edit.c b/src/edit.c index e1f30c7c2e36c5..f4c5edfc43a858 100644 --- a/src/edit.c +++ b/src/edit.c @@ -1625,7 +1625,8 @@ decodeModifyOtherKeys(int c) if (typebuf.tb_len >= 4 && (c == CSI || (c == ESC && *p == '['))) { idx = (*p == '['); - if (p[idx] == '2' && p[idx + 1] == '7' && p[idx + 2] == ';') + if (p[idx] == '2' && p[idx + 1] == '7' && p[idx + 2] == ';' && + kitty_protocol_state != KKPS_ENABLED) { form = 1; idx += 3; @@ -1640,9 +1641,10 @@ decodeModifyOtherKeys(int c) break; ++idx; } + int kitty_no_mods = argidx == 0 && kitty_protocol_state == KKPS_ENABLED; if (idx < typebuf.tb_len && p[idx] == (form == 1 ? '~' : 'u') - && argidx == 1) + && (argidx == 1 || kitty_no_mods)) { // Match, consume the code. typebuf.tb_off += idx + 1; @@ -1652,7 +1654,7 @@ decodeModifyOtherKeys(int c) typebuf_was_filled = FALSE; #endif - mod_mask = decode_modifiers(arg[!form]); + mod_mask = kitty_no_mods ? 0 : decode_modifiers(arg[!form]); c = merge_modifyOtherKeys(arg[form], &mod_mask); } } diff --git a/src/testdir/test_termcodes.vim b/src/testdir/test_termcodes.vim index 507753c21a7736..2b44b1553519de 100644 --- a/src/testdir/test_termcodes.vim +++ b/src/testdir/test_termcodes.vim @@ -2001,6 +2001,12 @@ func Test_xx08_kitty_response() \ kitty: 'y', \ }, terminalprops()) + call feedkeys("\[?1u") " simulate the kitty keyboard protocol is enabled + call feedkeys(':' .. GetEscCodeCSIu('V', '5') .. GetEscCodeCSIuWithoutModifier("\") .. "\\"\", 'Lx!') + call assert_equal("\"\", @:) + call feedkeys(':' .. GetEscCodeCSIu('V', '5') .. GetEscCodeCSIu("\", '129') .. "\\"\", 'Lx!') + call assert_equal("\"\", @:) + set t_RV= call test_override('term_props', 0) endfunc diff --git a/src/version.c b/src/version.c index b8852e39b4be4e..b3cc9ce55b041f 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 788, /**/ 787, /**/ From c0cba184f54e052cf8f04baca24bdee72a4b7de6 Mon Sep 17 00:00:00 2001 From: Milly Date: Wed, 16 Oct 2024 20:03:44 +0200 Subject: [PATCH 2/5] patch 9.1.0789: tests: ':resize + 5' has invalid space after '+' Problem: tests: ':resize + 5' has invalid space after '+' Solution: Correct the test (Milly) closes: #15884 Signed-off-by: Milly Signed-off-by: Christian Brabandt --- src/testdir/test_window_cmd.vim | 2 +- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/testdir/test_window_cmd.vim b/src/testdir/test_window_cmd.vim index 91adb9b1d0c69d..c8afab325fd0da 100644 --- a/src/testdir/test_window_cmd.vim +++ b/src/testdir/test_window_cmd.vim @@ -557,7 +557,7 @@ func Test_equalalways_on_close() 1wincmd w split 4wincmd w - resize + 5 + resize +5 " left column has three windows, equalized heights. " right column has two windows, top one a bit higher let height_1 = winheight(1) diff --git a/src/version.c b/src/version.c index b3cc9ce55b041f..12bdb6a1499099 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 789, /**/ 788, /**/ From 5e53fca76fd991d64d83429d74b573cc73116d66 Mon Sep 17 00:00:00 2001 From: Gregory Anders Date: Wed, 16 Oct 2024 21:30:01 +0200 Subject: [PATCH 3/5] runtime(jinja): Support jinja syntax as secondary filetype fixes: ##15880 closes: #15885 Signed-off-by: Gregory Anders Signed-off-by: Christian Brabandt --- runtime/syntax/jinja.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runtime/syntax/jinja.vim b/runtime/syntax/jinja.vim index 6000855ff7a8e8..fa32c05f17860b 100644 --- a/runtime/syntax/jinja.vim +++ b/runtime/syntax/jinja.vim @@ -2,8 +2,9 @@ " Language: Jinja " Maintainer: Gregory Anders " Upstream: https://gitlab.com/HiPhish/jinja.vim +" Last Change: 2024 Oct 16 -if exists('b:current_syntax') +if exists('b:current_syntax') && b:current_syntax =~? 'jinja' finish endif From 4bfb89996f227d5fbb4803f0d8dbd3105483b625 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Wed, 16 Oct 2024 21:58:17 +0200 Subject: [PATCH 4/5] runtime(help): fix end of sentence highlight in code examples closes: #15745 Co-authored-by: Danilo Rezende Signed-off-by: Christian Brabandt --- runtime/doc/repeat.txt | 8 ++++---- runtime/syntax/help.vim | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt index 73d6458d552527..d85e580f51ce3d 100644 --- a/runtime/doc/repeat.txt +++ b/runtime/doc/repeat.txt @@ -1,4 +1,4 @@ -*repeat.txt* For Vim version 9.1. Last change: 2024 Oct 05 +*repeat.txt* For Vim version 9.1. Last change: 2024 Oct 16 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1398,9 +1398,9 @@ For example, to profile the one_script.vim script file: > clear the profiling statistics and start profiling again. :prof[ile] pause - Don't profile until the following `:profile continue`. Can be - used when doing something that should not be counted (e.g., an - external command). Does not nest. + Stop profiling until the next `:profile continue` command. + Can be used when doing something that should not be counted + (e.g., an external command). Does not nest. :prof[ile] continue Continue profiling after `:profile pause`. diff --git a/runtime/syntax/help.vim b/runtime/syntax/help.vim index ff214e2768c61b..68f68c29604e6b 100644 --- a/runtime/syntax/help.vim +++ b/runtime/syntax/help.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: Vim help file " Maintainer: The Vim Project -" Last Change: 2024 Oct 08 +" Last Change: 2024 Oct 16 " Former Maintainer: Bram Moolenaar " Quit when a (custom) syntax file was already loaded @@ -47,7 +47,8 @@ syn match helpOption "'[a-z]\{2,\}'" syn match helpOption "'t_..'" syn match helpNormal "'ab'" syn match helpCommand "`[^` \t]\+`"hs=s+1,he=e-1 contains=helpBacktick -syn match helpCommand "\(^\|[^a-z"[]\)\zs`[^`]\+`\ze\([^a-z\t."']\|$\)"hs=s+1,he=e-1 contains=helpBacktick +" doesn't allow a . directly after an ending backtick. See :helpgrep `[^`,]\+ [^`,]\+`\. +syn match helpCommand "\(^\|[^a-z"[]\)\zs`[^`]\+`\ze\([^a-z\t."']\|[.?!]\?$\)"hs=s+1,he=e-1 contains=helpBacktick syn match helpHeader "\s*\zs.\{-}\ze\s\=\~$" nextgroup=helpIgnore syn match helpGraphic ".* \ze`$" nextgroup=helpIgnore if has("conceal") From 6c2fc377bfbfb6f1a46b1061413cd21116b596ed Mon Sep 17 00:00:00 2001 From: Milly Date: Wed, 16 Oct 2024 22:11:17 +0200 Subject: [PATCH 5/5] runtime(help): Update help syntax This commit makaes the following changes to the vim help syntax: - fix excessive URL detection in help, because `file:{filename}` in doc/options.txt is determined to be a URL. - update highlighting N for :resize in help - split Italian-specific syntax into separate help script - highlight `Note` in parentheses in help - update 'titlestring' behaviour in documentation for invalid '%' format closes: #15883 Signed-off-by: Milly Signed-off-by: Christian Brabandt --- runtime/doc/builtin.txt | 4 ++-- runtime/doc/options.txt | 6 ++++-- runtime/syntax/help.vim | 18 ++++++------------ runtime/syntax/help_it.vim | 17 +++++++++++++++++ 4 files changed, 29 insertions(+), 16 deletions(-) create mode 100644 runtime/syntax/help_it.vim diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index 32167d67fb8401..5d9a436688f1b5 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -1,4 +1,4 @@ -*builtin.txt* For Vim version 9.1. Last change: 2024 Oct 14 +*builtin.txt* For Vim version 9.1. Last change: 2024 Oct 16 VIM REFERENCE MANUAL by Bram Moolenaar @@ -11954,7 +11954,7 @@ wildmenumode() *wildmenumode()* For example to make work like in wildmode, use: > :cnoremap wildmenumode() ? "\\" : "\" < - (Note, this needs the 'wildcharm' option set appropriately). + (Note: this needs the 'wildcharm' option set appropriately). Return type: |Number| diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 40dc139b0876d7..075d3ee5eb4b92 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 9.1. Last change: 2024 Oct 14 +*options.txt* For Vim version 9.1. Last change: 2024 Oct 16 VIM REFERENCE MANUAL by Bram Moolenaar @@ -8705,7 +8705,9 @@ A jump table for the options with a short description can be found at |Q_op|. be restored if possible, see |X11|. When this option contains printf-style '%' items, they will be - expanded according to the rules used for 'statusline'. + expanded according to the rules used for 'statusline'. If it contains + an invalid '%' format, the value is used as-is and no error or warning + will be given when the value is set. This option cannot be set in a modeline when 'modelineexpr' is off. Example: > diff --git a/runtime/syntax/help.vim b/runtime/syntax/help.vim index 68f68c29604e6b..ae7e3bc6a7c086 100644 --- a/runtime/syntax/help.vim +++ b/runtime/syntax/help.vim @@ -57,6 +57,7 @@ else syn match helpIgnore "." contained endif syn keyword helpNote note Note NOTE note: Note: NOTE: Notes Notes: +syn match helpNote "\c(note\(:\|\>\)"ms=s+1 syn keyword helpWarning WARNING WARNING: Warning: syn keyword helpDeprecated DEPRECATED DEPRECATED: Deprecated: syn match helpSpecial "\" @@ -69,6 +70,10 @@ syn match helpSpecial "\[N]" syn match helpSpecial "N N"he=s+1 syn match helpSpecial "Nth"me=e-2 syn match helpSpecial "N-1"me=e-2 +" highlighting N for :resize in windows.txt +syn match helpSpecial "] -N\>"ms=s+3 +syn match helpSpecial "+N\>"ms=s+1 +syn match helpSpecial "\[+-]N\>"ms=s+4 " highlighting N of cinoptions-values in indent.txt syn match helpSpecial "^\t-\?\zsNs\?\s"me=s+1 " highlighting N of cinoptions-values in indent.txt @@ -145,7 +150,7 @@ syn match helpUnderlined "\t[* ]Underlined\t\+[a-z].*" syn match helpError "\t[* ]Error\t\+[a-z].*" syn match helpTodo "\t[* ]Todo\t\+[a-z].*" -syn match helpURL `\v<(((https?|ftp|gopher)://|(mailto|file|news):)[^' <>"]+|(www|web|w3)[a-z0-9_-]*\.[a-z0-9._-]+\.[^' <>"]+)[a-zA-Z0-9/]` +syn match helpURL `\v<(((https?|ftp|gopher)://|(mailto|file|news):)[^'" \t<>{}]+|(www|web|w3)[a-z0-9_-]*\.[a-z0-9._-]+\.[^'" \t<>{}]+)[a-zA-Z0-9/]` syn match helpDiffAdded "\t[* ]Added\t\+[a-z].*" syn match helpDiffChanged "\t[* ]Changed\t\+[a-z].*" @@ -157,17 +162,6 @@ if s:i > 0 exe "runtime syntax/help_" . strpart(expand("%"), s:i + 1, 2) . ".vim" endif -" Italian -if v:lang =~ '\' || v:lang =~ '_IT\>' || v:lang =~? "italian" - syn keyword helpNote nota Nota NOTA nota: Nota: NOTA: notare Notare NOTARE notare: Notare: NOTARE: - syn match helpSpecial "Nma"me=e-2 - syn match helpSpecial "Nme"me=e-2 - syn match helpSpecial "Nmi"me=e-2 - syn match helpSpecial "Nmo"me=e-2 - syn match helpSpecial "\[interv.]" - syn region helpNotVi start="{non" start="{solo" start="{disponibile" end="}" contains=helpLeadBlank,helpHyperTextJump -endif - syn sync minlines=40 diff --git a/runtime/syntax/help_it.vim b/runtime/syntax/help_it.vim new file mode 100644 index 00000000000000..e76851d446234a --- /dev/null +++ b/runtime/syntax/help_it.vim @@ -0,0 +1,17 @@ +" Vim syntax file +" Language: Italian Vim program help files *.itx +" Maintainer: The Vim Project +" Last Change: 2024 Oct 16 +" +" This script is sourced from syntax/help.vim. + +syn keyword helpNote nota Nota NOTA nota: Nota: NOTA: notare Notare NOTARE notare: Notare: NOTARE: +syn match helpNote "\c(nota\(:\|\>\)"ms=s+1 +syn match helpSpecial "Nma"me=e-2 +syn match helpSpecial "Nme"me=e-2 +syn match helpSpecial "Nmi"me=e-2 +syn match helpSpecial "Nmo"me=e-2 +syn match helpSpecial "\[interv.]" +syn region helpNotVi start="{non" start="{solo" start="{disponibile" end="}" contains=helpLeadBlank,helpHyperTextJump + +" vim: ts=8 sw=2