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 145740 - Wont comment multi-line selection at EOF
Summary: Wont comment multi-line selection at EOF
Status: RESOLVED WONTFIX
Alias: None
Product: ruby
Classification: Unclassified
Component: Editing (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Erno Mononen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-31 22:36 UTC by nigel_bris
Modified: 2010-03-26 14:08 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Image of failed selection (7.52 KB, text/plain)
2009-05-21 14:27 UTC, nigel_bris
Details

Note You need to log in before you can comment on or make changes to this bug.
Description nigel_bris 2008-08-31 22:36:42 UTC
If you select multiple lines at the end of a file and the last line (with text) has no LF/CR after it, when you press comment key stroke (cmd+/) it comments all 
lines except the last one (even though the cursor is on this line)
Comment 1 Torbjorn Norbye 2008-09-30 18:20:42 UTC
I tried this on a current build and it worked for both Ruby and ERb files... Perhaps there is something about the
specific lexical tokens on the lines you are selecting. Can you reproduce this with a trivial file (that you can attach) ?
Comment 2 nigel_bris 2008-09-30 23:33:48 UTC
Just tested on latest build....

This works if you start your selection from the bottom up....

If you select from a few lines above the EOF downwards to the bottom of the file... then use comment key... This does not comment the last line
Comment 3 Erno Mononen 2009-05-21 13:52:16 UTC
Seems to work for me now, even if I don't start from the bottom up. Please reopen if you still run into this with 6.7 
dev.
Comment 4 nigel_bris 2009-05-21 14:24:42 UTC
Still occurs in 200905131401

Image attached.... If you when you use keyboard and shift and down arrow (to select), with the cursor fully left. The cursor ends on the last line (in image the 
last end) which has no cr/lf at the end of it.   THe last line is not selected (but the cursor is on it) and when you press cmd+/ it commens out al selected lines 
not the last line where the cursor is
Comment 5 nigel_bris 2009-05-21 14:27:03 UTC
Created attachment 82549 [details]
Image of failed selection
Comment 6 Erno Mononen 2010-03-26 14:08:43 UTC
Returning to this after a long time.. this is actually by design, only the lines that are selected get commented out when commenting out multiple lines (different from commenting out the current line). In your example the last line isn't selected, so it doesn't get commented out even if the cursor is on it. I guess it is a matter of taste whether this is desirable or not, I personally prefer the current behavior. I'm closing this for now at least, but if more people complain about this we should reopen and reconsider.