From be09129614f9a5b503117cc1df9be07ce2e7e127 Mon Sep 17 00:00:00 2001 From: Yee Cheng Chin Date: Mon, 6 Feb 2023 05:51:18 -0800 Subject: [PATCH] Downgrade sh.vim syntax from version 205 to 204 The latest Vim runtime update upgraded sh.vim from version 204 to 205, which contains a bug (https://github.com/vim/vim/issues/11937). Since we are releasing MacVim soon, simply revert this change to have a stable build and we will revert this when Vim has fixed this upstream. --- runtime/syntax/sh.vim | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim index 13d74dbc17..6722d62c89 100644 --- a/runtime/syntax/sh.vim +++ b/runtime/syntax/sh.vim @@ -2,8 +2,8 @@ " Language: shell (sh) Korn shell (ksh) bash (sh) " Maintainer: Charles E. Campbell " Previous Maintainer: Lennart Schultz -" Last Change: Dec 20, 2022 -" Version: 205 +" Last Change: Nov 25, 2022 +" Version: 204 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH " For options and settings, please use: :help ft-sh-syntax " 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="\" ski " ===== if exists("b:is_kornshell") || exists("b:is_bash") || exists("b:is_posix") syn match shStatement "\" - syn region shAlias matchgroup=shStatement start="\\s\+\(\h[-._[:alnum:]]*\)\@=" skip="\\$" end="\>\|`" - syn region shAlias matchgroup=shStatement start="\\s\+\(\h[-._[:alnum:]]*=\)\@=" skip="\\$" end="=" -" syn region shAlias matchgroup=shStatement start="\\s\+\(\h[-._[:alnum:]]\+\)\@=" skip="\\$" end="\>\|`" -" syn region shAlias matchgroup=shStatement start="\\s\+\(\h[-._[:alnum:]]\+=\)\@=" skip="\\$" end="=" + syn region shAlias matchgroup=shStatement start="\\s\+\(\h[-._[:alnum:]]\+\)\@=" skip="\\$" end="\>\|`" + syn region shAlias matchgroup=shStatement start="\\s\+\(\h[-._[:alnum:]]\+=\)\@=" skip="\\$" end="=" " Touch: {{{1 " ===== @@ -335,7 +333,7 @@ syn match shEscape contained '\%(^\)\@!\%(\\\\\)*\\.' nextgroup=shComment " systems too, however, so the following syntax will flag $(..) as " an Error under /bin/sh. By consensus of vimdev'ers! if exists("b:is_kornshell") || exists("b:is_bash") || exists("b:is_posix") - syn region shCommandSub matchgroup=shCmdSubRegion start="\$(\ze[^(]\|$" skip='\\\\\|\\.' end=")" contains=@shCommandSubList + syn region shCommandSub matchgroup=shCmdSubRegion start="\$(\ze[^(]" skip='\\\\\|\\.' end=")" contains=@shCommandSubList syn region shArithmetic matchgroup=shArithRegion start="\$((" skip='\\\\\|\\.' end="))" contains=@shArithList syn region shArithmetic matchgroup=shArithRegion start="\$\[" skip='\\\\\|\\.' end="\]" contains=@shArithList syn match shSkipInitWS contained "^\s\+" @@ -485,9 +483,7 @@ endif " Parameter Dereferencing: {{{1 " ======================== -" Note: sh04 failure with following line -"if !exists("g:sh_no_error") && !(exists("b:is_bash") || exists("b:is_kornshell") || exists("b:is_posix")) -if !exists("g:sh_no_error") +if !exists("g:sh_no_error") && !(exists("b:is_bash") || exists("b:is_kornshell") || exists("b:is_posix")) syn match shDerefWordError "[^}$[~]" contained endif syn match shDerefSimple "\$\%(\h\w*\|\d\)" nextgroup=@shNoZSList