Skip to content

Commit 2e74830

Browse files
authored
Merge pull request #1358 from ychin/downgrade-sh-syntax-204
Downgrade sh.vim syntax from version 205 to 204
2 parents 19d0419 + be09129 commit 2e74830

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

runtime/syntax/sh.vim

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
" Language: shell (sh) Korn shell (ksh) bash (sh)
33
" Maintainer: Charles E. Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
44
" Previous Maintainer: Lennart Schultz <Lennart.Schultz@ecmwf.int>
5-
" Last Change: Dec 20, 2022
6-
" Version: 205
5+
" Last Change: Nov 25, 2022
6+
" Version: 204
77
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH
88
" For options and settings, please use: :help ft-sh-syntax
99
" This file includes many ideas from Eric Brunet (eric.brunet@ens.fr) and heredoc fixes from Felipe Contreras
@@ -190,10 +190,8 @@ syn region shEmbeddedEcho contained matchgroup=shStatement start="\<print\>" ski
190190
" =====
191191
if exists("b:is_kornshell") || exists("b:is_bash") || exists("b:is_posix")
192192
syn match shStatement "\<alias\>"
193-
syn region shAlias matchgroup=shStatement start="\<alias\>\s\+\(\h[-._[:alnum:]]*\)\@=" skip="\\$" end="\>\|`"
194-
syn region shAlias matchgroup=shStatement start="\<alias\>\s\+\(\h[-._[:alnum:]]*=\)\@=" skip="\\$" end="="
195-
" syn region shAlias matchgroup=shStatement start="\<alias\>\s\+\(\h[-._[:alnum:]]\+\)\@=" skip="\\$" end="\>\|`"
196-
" syn region shAlias matchgroup=shStatement start="\<alias\>\s\+\(\h[-._[:alnum:]]\+=\)\@=" skip="\\$" end="="
193+
syn region shAlias matchgroup=shStatement start="\<alias\>\s\+\(\h[-._[:alnum:]]\+\)\@=" skip="\\$" end="\>\|`"
194+
syn region shAlias matchgroup=shStatement start="\<alias\>\s\+\(\h[-._[:alnum:]]\+=\)\@=" skip="\\$" end="="
197195

198196
" Touch: {{{1
199197
" =====
@@ -335,7 +333,7 @@ syn match shEscape contained '\%(^\)\@!\%(\\\\\)*\\.' nextgroup=shComment
335333
" systems too, however, so the following syntax will flag $(..) as
336334
" an Error under /bin/sh. By consensus of vimdev'ers!
337335
if exists("b:is_kornshell") || exists("b:is_bash") || exists("b:is_posix")
338-
syn region shCommandSub matchgroup=shCmdSubRegion start="\$(\ze[^(]\|$" skip='\\\\\|\\.' end=")" contains=@shCommandSubList
336+
syn region shCommandSub matchgroup=shCmdSubRegion start="\$(\ze[^(]" skip='\\\\\|\\.' end=")" contains=@shCommandSubList
339337
syn region shArithmetic matchgroup=shArithRegion start="\$((" skip='\\\\\|\\.' end="))" contains=@shArithList
340338
syn region shArithmetic matchgroup=shArithRegion start="\$\[" skip='\\\\\|\\.' end="\]" contains=@shArithList
341339
syn match shSkipInitWS contained "^\s\+"
@@ -485,9 +483,7 @@ endif
485483

486484
" Parameter Dereferencing: {{{1
487485
" ========================
488-
" Note: sh04 failure with following line
489-
"if !exists("g:sh_no_error") && !(exists("b:is_bash") || exists("b:is_kornshell") || exists("b:is_posix"))
490-
if !exists("g:sh_no_error")
486+
if !exists("g:sh_no_error") && !(exists("b:is_bash") || exists("b:is_kornshell") || exists("b:is_posix"))
491487
syn match shDerefWordError "[^}$[~]" contained
492488
endif
493489
syn match shDerefSimple "\$\%(\h\w*\|\d\)" nextgroup=@shNoZSList

0 commit comments

Comments
 (0)