LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Vim syntax highlighting problem (https://www.linuxquestions.org/questions/linux-software-2/vim-syntax-highlighting-problem-458778/)

darkwing0o0rama 06-27-2006 10:19 AM

Vim syntax highlighting problem
 
yo, i dunno if this is the place to try to find an answer to this, but I couldn't seem to find any info about it.

VIM seems to stop correctly syntax hilighting in some javascript files i'm working with...
I haven't checked other languages, or if anything else breaks it, but it stops working after a function declaration has parentheses after it...

for example:
"
function thefirstfunction
{
...
}
" seems to hilight everything correctly and doesn't break it, however

"
function I_break_hilighting(...)
{
...
}
" Breaks hilighting for anything after the parentheses

some things will still hilight, but it's kinda random
comments wont hilight, several keywords won't be highlighted, and several other weird hilighting issues

if anybody else has run into this, it'd be great to fix, just kinda a annoyance that makes working with Javascript a bit harder :-P

bigrigdriver 06-27-2006 11:18 AM

I've seen that behavior in vim. It happens when you have an unmatched comment mark (as in c comment /*...*/) or an unmatched parenthesis. The highlighting fails after the unmatched comment or parenthesis. Read over the code carefully, looking for unmatched symbols: quotes, parentheses, comments, etc.

darkwing0o0rama 06-27-2006 11:40 AM

exactly, i know that is how it acts when it mismatches something, but something is up with the hilighting that makes it think the parentheses after a function definition aren't matched

there is ABSOLUTELY NOTHING in the file before something like this:

function blah(arg1,arg2)

and it thinks something is mismatched for the rest of the file

any help?

(thanks for the reply, but it's not a typo or a real mismatch)

darkwing0o0rama 06-27-2006 11:43 AM

i think the syntax hilighting rules for javascript are just a little screwy and dont even account for there being parentheses after the function keyword? i don't know, that's what i'd guess is happening

anybody know otherwise or that can give me a little help fixing it?

darkwing0o0rama 06-27-2006 11:52 AM

did some messing around testing it and indeed, parentheses ARE busting up the syntax hilighting and the highlighting only works when the parentheses are MISMATCHED ....

a bit odd

can anybody else confirm a problem with javascript highlighting like this?
or do i have something screwed up for some reason...

darkwing0o0rama 06-27-2006 12:01 PM

sorry for posting so much to my own question :-P

just want to say that it's only the parens that are messing it up, try just popping some parentheses at the beginning, and the syntax will screw up (unless its just a problem with me)


All times are GMT -5. The time now is 07:44 PM.