Thursday, December 29, 2011

Re: weird highlighting when i edit java code

On Dec 29, 2011, at 10:21 AM, Tony Mechelynck wrote:

>> 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
>
> so the default is to have all those highlighted as error; define that variable (with any value) to remove that highlight.

oh wow, would you look at that! so by default since "java_allow_cpp_keywords" isn't defined it shows me false errors.

On Dec 29, 2011, at 7:22 AM, Taylor Hedberg wrote:

> The only reason I can think of
> for doing that is that if you happen to be a C++ programmer who is
> learning Java, you might accidentally start writing C++ in the middle of
> your Java code since the syntax of the two languages is somewhat
> similar.


hmm i never learned C++. does vim do this for all languages similar to the currently edited language by default? at my last job i used a lot of C# but it doesn't highlight disjoint C# keywords. i tried using some Ruby keywords in Python but those didn't show red errors either. i feel like that can't be the real reason.

i've read a lot of complaints about this on the web now but i couldn't find a reason for why this is the default behavior. seems like it should be turned off. is this a distribution thing? i only had this problem on ubuntu. the version of vim that comes default on my mac doesn't behave this way by default. any advice on where i can submit a patch?

rian

--
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

No comments: