From fef27f00690ab0860e24eba0637e57d0cbd44812 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 9 Nov 2017 09:33:13 +1300 Subject: Fix 'while'/'until' highlighting in syntax/sh.vim These two changes coax syntax/sh.vim into realising that POSIX shell does not specify 'until' as a builtin (that's a Bash/Ksh thing), and that POSIX shell is able to nest 'while' loops within other blocks (that's not a Bash/Ksh thing). --- vim/after/syntax/sh.vim | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'vim/after/syntax/sh.vim') diff --git a/vim/after/syntax/sh.vim b/vim/after/syntax/sh.vim index ba209e99..98b582bd 100644 --- a/vim/after/syntax/sh.vim +++ b/vim/after/syntax/sh.vim @@ -100,6 +100,20 @@ if exists('b:is_posix') \ PS4 \ PWD + " Core syntax/sh.vim thinks 'until' is a POSIX control structure keyword, + " but it isn't. Reset shRepeat and rebuild it with just 'while'. I only + " sort-of understand what this does, but it works. + syntax clear shRepeat + syntax region shRepeat + \ matchgroup=shLoop + \ start="\ Date: Thu, 9 Nov 2017 10:33:49 +1300 Subject: Remove false error flagging for sh char class glob The syntax highlighter flags this code with an error on the final square bracket: `case $foo in [![:ascii:]]) ;; esac`, but that's all legal. I'm not yet sure how to fix it, so will just turn the error group for now. --- vim/after/syntax/sh.vim | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'vim/after/syntax/sh.vim') diff --git a/vim/after/syntax/sh.vim b/vim/after/syntax/sh.vim index 98b582bd..8025c567 100644 --- a/vim/after/syntax/sh.vim +++ b/vim/after/syntax/sh.vim @@ -18,6 +18,11 @@ syntax clear shDerefWordError " probably not worth keeping the error. syntax clear shParenError +" The syntax highlighter flags this code with an error on the final square +" bracket: `case $foo in [![:ascii:]]) ;; esac`, but that's all legal. I'm not +" yet sure how to fix it, so will just turn the error group for now. +syntax clear shTestError + " Highlighting corrections specific to POSIX mode if exists('b:is_posix') -- cgit v1.2.3