Bug#486114: sh.vim's highlighting of loop/block keywords

Charles Campbell Charles.E.Campbell at nasa.gov
Tue Jul 1 16:32:39 UTC 2008


James Vega wrote:
> Chip,
>
> Currently, the sh highlighting uses \< and \> to delimit the match for
> "for", "if", "do", etc.  This causes problematic highlighting with
> commands like "git for-each-ref" since the for in that command is
> matched.
>
> There are a couple of possible solutions that come to mind, but adding
> "-" to 'iskeyword' seems to be the easiest approach.  Otherwise, the
> regex would need to become a bit more complicated.
>   

I think there's a problem with adding "-" to iskeyword: consider

x-y-z=3

This doesn't work, of course, but the highlighting for it is different 
with "set isk+=-" , and catching the problem is visually easier as is.  
Perhaps changing the regions so that they use  \<for\_s will work (and 
similar constructs for while and until).

Regards,
Chip Campbell







More information about the pkg-vim-maintainers mailing list