]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(sh): Update sh syntax and add shDerefOffset to shDerefVarArray for bash ...
authorLucien Grondin <grondilu@yahoo.fr>
Sat, 4 Nov 2023 08:41:37 +0000 (09:41 +0100)
committerGitHub <noreply@github.com>
Sat, 4 Nov 2023 08:41:37 +0000 (09:41 +0100)
Add shDerefOffset to shDerefVarArray.

Example code:

```bash
declare -a a=({a..z})

echo "${a[@]:1:3}"
```

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

index 0fb10f0e515f4bd5dac5c942f52f471169703445..e2b194719701ea98c473c730e6a6c6d83f7f9ed6 100644 (file)
@@ -531,7 +531,7 @@ if exists("b:is_kornshell") || exists("b:is_posix")
 endif
 
 " sh ksh bash : ${var[... ]...}  array reference: {{{1
-syn region  shDerefVarArray   contained        matchgroup=shDeref start="\[" end="]"   contains=@shCommandSubList nextgroup=shDerefOp,shDerefOpError
+syn region  shDerefVarArray   contained        matchgroup=shDeref start="\[" end="]"   contains=@shCommandSubList nextgroup=shDerefOp,shDerefOpError,shDerefOffset
 
 " Special ${parameter OPERATOR word} handling: {{{1
 " sh ksh bash : ${parameter:-word}    word is default value