neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 186851b1bd13049ecf3518897bc58c6ab42f899d
parent d8621a53ac283d651a4e5e59547af8e718834693
Author: zeertzjq <zeertzjq@outlook.com>
Date:   Wed,  7 May 2025 09:45:51 +0800

vim-patch:87947a9: runtime(sh): Update syntax, match KornShell compound arrays

closes: vim/vim#17268

https://github.com/vim/vim/commit/87947a9a769ad43216beae7946c8b0bda9f8024a

Co-authored-by: Doug Kearns <dougkearns@gmail.com>

Diffstat:
Mruntime/syntax/sh.vim | 10++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim @@ -12,6 +12,7 @@ " 2025 Apr 10 improve shell detection (#17084) " 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 " Version: 208 " Former URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH " For options and settings, please use: :help ft-sh-syntax @@ -511,13 +512,18 @@ syn match shSetOption "\s\zs[-+][a-zA-Z0-9]\+\>" contained syn match shVariable "\<\h\w*\ze=" nextgroup=shVarAssign if exists("b:is_bash") " The subscript form for array values, e.g. "foo=([2]=10 [4]=100)". - syn region shArrayValue contained start="\[\%(..\{-}\]=\)\@=" end="\]=\@=" contains=@shArrayValueList nextgroup=shVarAssign + syn region shArrayValue contained start="\[\%(..\{-}\]=\)\@=" end="\]=\@=" contains=@shArrayValueList nextgroup=shVarAssign syn cluster shArrayValueList contains=shArithmetic,shArithParen,shCommandSub,shDeref,shDerefSimple,shExpr,shNumber,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shSpecial,shParen,bashSpecialVariables,shParenError + syn region shArrayRegion contained matchgroup=shShellVariables start="(" skip='\\\\\|\\.' end=")" contains=@shArrayValueList,shArrayValue,shComment +elseif exists("b:is_kornshell") + " The subscript form for array values, e.g. "foo=([2]=10 [4]=100)". + syn region shArrayValue contained start="\[\%(..\{-}\]=\)\@=" end="\]=\@=" contains=@shArrayValueList nextgroup=shVarAssign + syn cluster shArrayValueList contains=shArithmetic,shArithParen,shCommandSub,shDeref,shDerefSimple,shExpr,shNumber,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shSpecial,shParen,kshSpecialVariables,shParenError + syn region shArrayRegion contained matchgroup=shShellVariables start="(" skip='\\\\\|\\.' end=")" contains=@shArrayValueList,shArrayValue,shComment,shArrayRegion endif if exists("b:is_bash") || exists("b:is_kornshell") syn match shVariable "\<\h\w*\%(\[..\{-}\]\)\=\ze\%([|^&*/%+-]\|[<^]<\|[>^]>\)\==" contains=shDerefVarArray nextgroup=shVarAssign syn match shVarAssign contained "\%([|^&*/%+-]\|[<^]<\|[>^]>\)\==" nextgroup=shArrayRegion,shPattern,shDeref,shDerefSimple,shDoubleQuote,shExDoubleQuote,shSingleQuote,shExSingleQuote,shVar - syn region shArrayRegion contained matchgroup=shShellVariables start="(" skip='\\\\\|\\.' end=")" contains=@shArrayValueList,shArrayValue,shComment else syn match shVarAssign contained "=" nextgroup=shPattern,shDeref,shDerefSimple,shDoubleQuote,shExDoubleQuote,shSingleQuote,shExSingleQuote,shVar endif