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 108974 - Editor feature request: continue comment lines
Summary: Editor feature request: continue comment lines
Status: NEW
Alias: None
Product: ruby
Classification: Unclassified
Component: Editing (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@ruby
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-05 19:34 UTC by jamespb
Modified: 2011-01-28 20:10 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
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:34:20 UTC
If I'm typing a comment and hit return, I'd like the next line to automatically start with '# '
Comment 1 Torbjorn Norbye 2007-07-06 20:39:59 UTC
I added that a while back, but I was afraid to enable it, thinking it might be too disruptive for people.

You can enable it by running the IDE with this flag (add to {userdir}/etc/nbrubyide.conf to make it stick)

-J-Druby.cont.comment=true

I just added some unit tests for this, and made one important improvement: Hitting backspace on "# " will delete the space AND the "#", so this makes it 
easier to "finish" the comment.   I also made sure that it also only continues the comment when the comment is on a line by itself, thus

    foo :x => :y  # abc def ghi

will not produce "# " on the next line.

Do you have any information on what other editors or IDEs do for this feature? Is it enabled by default?  I just pulled up RadRails as well as DLTK and in 
neither one did it do this automatically, unless it's restricted in some way I can't figure out. Perhaps TextMate is doing this?

(Builds from the last couple of weeks should respond to the ruby.cont.comment flag; build 2776 will have the deletion-fix which backs up over both chars)

I should really go and add some more detailed Ruby source options soon. I've been putting it off since the whole options dialog is being cleaned up and I 
don't want to do it one way only to find that it's gotta be done another way.
Comment 2 jamespb 2007-07-06 21:37:25 UTC
Aptana used to - it broke recently, and is fixed but not released (see
http://www.aptana.com/forums/viewtopic.php?t=1690&highlight=comment).

Emacs supported comment continuations.  Although emacs has two different sorts of returns; one said "give me a plain new
line" and the other was "give me a new line, correctly indented and decorated for whatever mode I'm in."

Just tried Visual Studio 2005, and for C# it does automatic continues for comment lines starting with ///, but not for
comment lines starting with //.  Beats me why or what the difference is.

Comment 3 jamespb 2007-07-06 21:38:52 UTC
FYI, I like the emacs way the best (control-j for plain new line, alt-j for decorated new line, presumably starting with
# if you're in a comment), but that may strike a lot of people as weird.
Comment 4 jamespb 2007-07-07 20:52:06 UTC
-J-Druby.cont.comment=true does almost what I want.  The addition I'd like would be to indent to the same level of
whitespace as the previous comment:

# here
#   and stuff
#   (automatically indent to here)

But clearly not a high priority.