Skip to content

Commit ce3b013

Browse files
author
Lucien Grondin
authored
runtime(sh): Update sh syntax and add shDerefOffset to shDerefVarArray for bash (#13480)
Add shDerefOffset to shDerefVarArray. Example code: ```bash declare -a a=({a..z}) echo "${a[@]:1:3}" ``` Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent 2f54c13 commit ce3b013

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

runtime/syntax/sh.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ if exists("b:is_kornshell") || exists("b:is_posix")
531531
endif
532532

533533
" sh ksh bash : ${var[... ]...} array reference: {{{1
534-
syn region shDerefVarArray contained matchgroup=shDeref start="\[" end="]" contains=@shCommandSubList nextgroup=shDerefOp,shDerefOpError
534+
syn region shDerefVarArray contained matchgroup=shDeref start="\[" end="]" contains=@shCommandSubList nextgroup=shDerefOp,shDerefOpError,shDerefOffset
535535

536536
" Special ${parameter OPERATOR word} handling: {{{1
537537
" sh ksh bash : ${parameter:-word} word is default value

0 commit comments

Comments
 (0)