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 |
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.
|
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) |
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? |
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... |
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. |