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

James Vega jamessan at debian.org
Tue Jul 1 17:01:04 UTC 2008


On Tue, Jul 01, 2008 at 12:32:39PM -0400, Charles Campbell wrote:
> 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).

There would still be issues with commands named "...-for" or the like.
Although, such commands may be uncommon enough in practice that it
doesn't matter (like "for-..." was until git came around).

-- 
James
GPG Key: 1024D/61326D40 2003-09-02 James Vega <jamessan at debian.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/pkg-vim-maintainers/attachments/20080701/3bb3b2e4/attachment-0001.pgp 


More information about the pkg-vim-maintainers mailing list