]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(sh): add shDblParen to shLoopList for bash (#13445)
authorLucien Grondin <grondilu@yahoo.fr>
Sat, 28 Oct 2023 19:40:48 +0000 (21:40 +0200)
committerGitHub <noreply@github.com>
Sat, 28 Oct 2023 19:40:48 +0000 (21:40 +0200)
add shDblParen to shLoopList to correctly highlight
arithmetic expressions for Bash and Ksh

This should allow code such as:

```bash
declare -i i j
for i in foo bar
do ((j = 1 << j))
done
```

Signed-off-by: Lucien Grondin <grondilu@yahoo.fr>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/syntax/sh.vim

index 8674ded9e444651c32343b73f824ffa3314aed27..d64c3a9b0899012f6c4b5d77157e94dacd59a4d4 100644 (file)
@@ -163,7 +163,7 @@ syn cluster shIdList        contains=shArithmetic,shCommandSub,shCommandSubBQ,shWrapLin
 syn cluster shIfList   contains=@shLoopList,shDblBrace,shDblParen,shFunctionKey,shFunctionOne,shFunctionTwo
 syn cluster shLoopList contains=@shCaseList,@shErrorList,shCaseEsac,shConditional,shDblBrace,shExpr,shFor,shIf,shOption,shSet,shTest,shTestOpr,shTouch
 if exists("b:is_kornshell") || exists("b:is_bash")
- syn cluster shLoopoList       add=shForPP
+ syn cluster shLoopList        add=shForPP,shDblParen
 endif
 syn cluster shPPSLeftList      contains=shAlias,shArithmetic,shCmdParenRegion,shCommandSub,shCtrlSeq,shDeref,shDerefSimple,shDoubleQuote,shEcho,shEscape,shExDoubleQuote,shExpr,shExSingleQuote,shHereDoc,shNumber,shOperator,shOption,shPosnParm,shHereString,shRedir,shSingleQuote,shSpecial,shStatement,shSubSh,shTest,shVariable
 syn cluster shPPSRightList     contains=shDeref,shDerefSimple,shEscape,shPosnParm