aboutsummaryrefslogtreecommitdiff
path: root/runtime/syntax/python.vim
diff options
context:
space:
mode:
authorphanium <91544758+phanen@users.noreply.github.com>2026-07-22 19:26:09 +0800
committerGitHub <noreply@github.com>2026-07-22 07:26:09 -0400
commit526365a8d13fc28ebb52042ccd2b8b29e0054ea7 (patch)
tree46ea2ea37bc196efbd02469b461dd2d5d1aa16b0 /runtime/syntax/python.vim
parentc9326e6df84ce710c540d241a7bc3e39c19dc912 (diff)
downloadrneovim-526365a8d13fc28ebb52042ccd2b8b29e0054ea7.tar.gz
rneovim-526365a8d13fc28ebb52042ccd2b8b29e0054ea7.tar.bz2
rneovim-526365a8d13fc28ebb52042ccd2b8b29e0054ea7.zip
fix(help): handle escape edge cases #40901
* fix(help): preserve multi-letter CTRL modifiers in :help subject Problem: After PR 39537 normalized `CTRL-U-default` by excluding `-` from the trigger char class, the regex `(CTRL%-[^{])([^-_\\])` also fires between `CTRL-S` and the `H` of the `SHIFT` modifier in tags like `c_CTRL-SHIFT-V`, splitting it into the non-existent `c_CTRL-S_HIFT-V`. Solution: Exclude uppercase letters from the char class so a multi-letter modifier following `CTRL-X` (e.g. `SHIFT`, `ALT`) is no longer split. The `-` exclusion from 39537 is preserved so `i_CTRL-U-default` still works. * fix(help): escape ~ in expr-=~? exception to keep regex valid Problem: The `expr-=~?` exception in the tag alias table maps to `=~?`, but in Vim's regex engine `~` refers to the previous substitute pattern. With no prior substitute the pattern fails to compile, so `:help expr-=~?` returns E149 even though the tag exists. Solution: Escape `~` as \\\~` so the alias expands to a valid regex (`=\\\~?`) that substring-matches the `expr-=~?` tag. Other `expr-X?` entries are unaffected since they don't contain `~`. * fix(help): don't insert _ before CTRL- when preceded by - Problem: The rule `([^_])CTRL%- -> %1_CTRL-` inserts an underscore between any non-underscore char and `CTRL-`, which wrongly rewrites tags like `map-CTRL-C` and `telnet-CTRL-]` (where `CTRL-` is literal text in the tag, not a key chord). Solution: Exclude `-` from the trigger char class so a hyphen immediately before `CTRL-` is preserved. The existing behavior for `iCTRL-GCTRL-J` -> `i_CTRL-G_CTRL-J` is unaffected because the `G` before `CTRL-J` is not `-`. * fix(help): only treat ^X as caret notation for valid control chars Problem: The regex `%^([^_])` converts any `^X` to `CTRL-X`, including `:set^=` where `^=` is literal text in the tag, not a caret-notation control character. Solution: Restrict the transformation to caret-notation chars (`%a` or one of `?@[\\]^{}`). This matches the C reference behavior where `^X` is only converted when X is alphanumeric or one of the control-notation punctuation chars. `{` is retained so `^{char}` still maps to the `CTRL-{char}` placeholder tag.
Diffstat (limited to 'runtime/syntax/python.vim')
0 files changed, 0 insertions, 0 deletions