Srinivas Rao. M wrote:
I am facing this syntax highlighting problem here for the following code
segment. The problem is if we put this code in a file having .c
extension. The same macro color is shown for the main() function also.
Does anyone else faced this problem with vim7 ?
regards,
s
===========somefile.c=====================
#define GET_TAG_STRING(tagFeildPtr) { \
*feildEndP = 'a'; \
*feildEndP+1 = '\0'; \
}
main()
{
}
Hello!
The code text looks fine to me. May I suggest trying
nmap <silent> <F10> :echo "hi<" .
synIDattr(synID(line("."),col("."),1),"name") . '> trans<' .
synIDattr(synID(line("."),col("."),0),"name") . "> lo<" .
synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">"<CR>
(that's all one line in case some mailer thinks its smarter than me)
Put that into your <.vimrc> file (you *do* have one so that :echo &cp
shows 0, I hope), then when next
editing your <somefile.c>, place the cursor atop the "main" and press
the <F10> key. You should get a
message telling what highlighting is being used. Well, what syntax
highlighting is being used. If you
happened to have done a search for "main" and have hlsearch enabled,
then "main" will be highlighted
for reasons that bypass the syntax highlighting.
Regards,
Chip Campbell