Thursday, March 25, 2010

Re: Why is "template" highlighted in Java code

On Thursday 25 March 2010 11:34:50 Benjamin R. Haskell wrote:

> From :help ft-java-syntax :
>
> In order to help you write code that can be easily
> ported between Java and C++, all C++ keywords can be marked
> as an error in a Java program. To have this add this line in
> your .vimrc file:
>
> :let java_allow_cpp_keywords = 0
>
> So, it seems like the default is supposed to be 1, which
> seems reasonable. (That is: the user must choose to turn
> those keywords into errors.) The syntax file on my system
> appears to confirm that. (Line 126 sets it to 1 if it isn't
> set.) Perhaps your distribution made the choice (mistake,
> IMO) to override that?

maybe my runtime is out of date? my java.vim is dated
2009-mar-14

the way it's coded:

if !exists("java_allow_cpp_keywords")
syn keyword javaError auto delete extern friend inline
redeclared
syn keyword javaError register signed sizeof struct template
typedef union
syn keyword javaError unsigned operator
endif

(well before my mailer scrunched the long lines)

appears to me the default is to flag the cpp keywords as
errors unless and until the user puts

let java_allow_cpp_keywords = 1

in their .vimrc -- this leads me to think perhaps the help on
this subject isn't really clear on this matter

sc

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

To unsubscribe from this group, send email to vim_use+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

No comments: