On Jan 29, 6:02 pm, Ben Schmidt <[email protected]> wrote:
> Ben Fritz wrote:
> > I use the standard C syntax rules, but I have added a couple of rules
> > in my after/syntax/c.vim file to add some additional syntax folding. I
> > have narrowed my problem down to the following addition:
>
> > " add folding of multiline () groups
> > syn region SynFoldParen
> >       \ start="(" end=")"
> >       \ skip=+"\%(\\"\|[^"]\)\{-}\\\@<!"\|'[^']\{-}'\|'\\''\|//.*+
> >       \ transparent fold keepend extend
> >       \ containedin=ALLBUT,cComment,cCommentL,cString,cCppString
>
> > Using this addition, with this code::
>
> > void foo()
> > {
> >   printf("look how {braces} break highlighting!\n");
> > }
>
> > makes the "Constant" highlighting go away after the closing brace
> > ('}') in the printf statement.
>
> Where is the 'Constant' highlighting meant to be? I don't get it. Is it
> a custom syntax rule too? Or maybe some setting in your vimrc enables
> it? Perhaps check your syntax/c.vim is up to date, and send us your
> custom file to see if we can reproduce it? Also quote your Vim version,
> perhaps, in case it's relevant.
>
> Ben.
>

I'm using Vim 7.2.88 from the "Cream" page.

My c.vim syntax file has the following heading:

" Vim syntax file
" Language:     C
" Maintainer:   Bram Moolenaar <[email protected]>
" Last Change:  2008 Mar 19

I'm using the following c.vim options:

let g:c_syntax_for_h = 1
let g:c_ansi_typedefs = 1
let g:c_ansi_constants = 1

I'm sorry about the confusion of the "Constant" group...my colorscheme
has the following line:

hi link String  Constant

c.vim links the cString group to String at line 358.

Everything between the double-quotes in the printf statement except
for the "\n", on my build with just the standard syntax rules, is
highlighted as Constant. The "\n" is highlighted as "Special". But,
the highlighting changes if I introduce that one fold rule so that
*all* highlighting ends at the closing brace inside the quotes,
resuming on the next line.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to