LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 06-27-2006, 10:19 AM   #1
darkwing0o0rama
LQ Newbie
 
Registered: Jun 2006
Posts: 5

Rep: Reputation: 0
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
 
Old 06-27-2006, 11:18 AM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,740

Rep: Reputation: 298Reputation: 298Reputation: 298
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.
 
Old 06-27-2006, 11:40 AM   #3
darkwing0o0rama
LQ Newbie
 
Registered: Jun 2006
Posts: 5

Original Poster
Rep: Reputation: 0
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)
 
Old 06-27-2006, 11:43 AM   #4
darkwing0o0rama
LQ Newbie
 
Registered: Jun 2006
Posts: 5

Original Poster
Rep: Reputation: 0
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?
 
Old 06-27-2006, 11:52 AM   #5
darkwing0o0rama
LQ Newbie
 
Registered: Jun 2006
Posts: 5

Original Poster
Rep: Reputation: 0
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...
 
Old 06-27-2006, 12:01 PM   #6
darkwing0o0rama
LQ Newbie
 
Registered: Jun 2006
Posts: 5

Original Poster
Rep: Reputation: 0
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)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
vim syntax highlighting problems. donniejones18 Linux - Software 7 04-16-2006 08:03 PM
vim syntax highlighting MiniMe001 Linux - General 2 06-19-2005 11:08 AM
Adding Syntax Highlighting to VIM TastyWheat Linux - Software 2 02-27-2004 03:37 AM
How to make vim has syntax highlighting ICO Linux - General 4 01-05-2004 10:35 AM
Vim syntax highlighting NSKL Linux - Software 2 11-09-2002 02:39 AM


All times are GMT -5. The time now is 11:29 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration