This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 108972 - Incorrect highlighting with multiple # on a line
Summary: Incorrect highlighting with multiple # on a line
Status: NEW
Alias: None
Product: ruby
Classification: Unclassified
Component: Editing (show other bugs)
Version: 6.x
Hardware: PC Windows Vista
: P4 blocker (vote)
Assignee: issues@ruby
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-05 19:30 UTC by jamespb
Modified: 2011-01-28 20:10 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jamespb 2007-07-05 19:30:54 UTC
Enter a comment line like so:

# foo #<Foo>

The 'Foo' is hightlighted as if it weren't a comment.
Comment 1 Torbjorn Norbye 2007-07-06 20:54:51 UTC
This is supposed to be a feature.

NetBeans is not only lexing the Ruby language for you, it recursively also lexes comments and strings such that in Strings for example, escape sequences 
use bold fonts to set them apart from normal strings.

See http://wiki.netbeans.org/wiki/attach/RubyEditing/rdoc-comments.png for an example - or open-type say the "TSort" class from the Ruby library and 
scroll through it to look at the various ways comments are marked up.

In comments, the following are tokenized into a separate category:

- rdoc directives (:nodoc: etc.)
- Words surrounded by special rdoc chars: *bold*, _italic_, +monospace+.  These are shown using bold, italic and monospace fonts respectively
- Links (http://, ftp:, as well as local method references - prefixed by "#") - these are shown as underlined/blue hyperlinks
- HTML tags, such as <em>, <b>, etc.

What you're running into here is the last thing; "<Foo>" is treated as a potential HTML tag.

Perhaps I should restrict the matches to known HTML 4 tags rather than anything embedded in <>'s ?
Comment 2 jamespb 2007-07-06 21:22:31 UTC
I'll occasionally use <thing> is a kind of quote mechanism, so I was a little surprised to see it in a different color.
 It sounds useful, but it's a bit surprising that HTML would be highlighted differently in comments than the comment
itself.  Probably just needs some getting used to.  

But this seems to be an unintended side effect:

# Blah blah blah something about an object: #<Object:0x4661c10>

since that's the standard text representation of an object, not HTML.  (And if it should be highlighted, the # should
have the same highlighting as the rest of the #<Whatever:0x00000000>)
Comment 3 Erno Mononen 2009-04-23 12:42:33 UTC
Still reproducible, but this seems rather minor, so I'm downgrading to P4.