runtime(sh): Update syntax, improve wildcard character class matching
Commit:
https://github.com/vim/vim/commit/839b79eeb33a41a5b368ad56aeaaa94f5fbace92
Author: Doug Kearns <[email protected]>
Date: Sat May 10 20:57:10 2025 +0200
runtime(sh): Update syntax, improve wildcard character class matching
- Default to POSIX supported classes.
- Add a KornShell specific class list.
- Remove "or" from the Bash class list, presumably a typo.
closes: #17293
Signed-off-by: Christian Brabandt <[email protected]>
Signed-off-by: Doug Kearns <[email protected]>
diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim
index c04b16fa0..b0e02b981 100644
--- a/runtime/syntax/sh.vim
+++ b/runtime/syntax/sh.vim
@@ -13,6 +13,7 @@
" 2025 Apr 29 match escaped chars in test operands (#17221)
" 2025 May 06 improve single-quote string matching in parameter
expansions
" 2025 May 06 match KornShell compound arrays
+" 2025 May 10 improve wildcard character class lists
" Version: 208
" Former URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH
" For options and settings, please use: :help ft-sh-syntax
@@ -325,7 +326,7 @@ endif
" Character Class In Range: {{{1
" =========================
syn match shCharClassOther contained "\[:\w\{-}:\]"
-syn match shCharClass contained
"\[:\(backspace\|escape\|return\|xdigit\|alnum\|alpha\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|tab\):\]"
+syn match shCharClass contained
"\[:\%(alnum\|alpha\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|xdigit\):\]"
syn match shCollSymb contained "\[\..\{-}\.\]"
syn match shEqClass contained "\[=.\{-}=\]"
@@ -378,7 +379,9 @@ syn region shCaseDoubleQuote matchgroup=shQuote
start=+"+ skip=+\\\|\.+ end=
syn region shCaseCommandSub start=+`+ skip=+\\\|\.+ end=+`+
contains=@shCommandSubList skipwhite skipnl nextgroup=shCaseBar
contained
call s:GenerateBracketExpressionItems({'itemGroup': 'shCaseRange',
'bracketGroup': 'shBracketExprDelim', 'extraArgs': 'skip=+\\+ contained'})
if exists("b:is_bash")
- syn match shCharClass
'\[:\%(alnum\|alpha\|ascii\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|word\|or\|xdigit\):\]'
contained
+ syn match shCharClass
"\[:\%(alnum\|alpha\|ascii\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|word\|xdigit\):\]"
contained
+elseif exists("b:is_kornshell")
+ syn match shCharClass
"\[:\%(alnum\|alpha\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|word\|xdigit\):\]"
contained
endif
" Misc: {{{1
"======
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/vim_dev/E1uDpQb-002TRG-5L%40256bit.org.