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.
See the screenshots in the attached image. When selecting a couple of lines, then when the first line has no whitespace at the beginning (screenshot A), Shift Line Right (Alt+Shift+Right) indents the selection on the first line (screenshot B). This is inconvenient for copy&paste. When on the other hand the first line does have whitespace at the beginning (screenshot C), then Shift Line Right works as expected (screenshot D), i.e. it does not indent the selection on the first line, but then unshifting with Shift Line Left (Alt+Shift+Left) introduces an indent (screenshot E). Expected behavior: When whole lines are selected, shifting the lines left or right should keep the whole lines selected and not introduce any indent.
Created attachment 45888 [details] The Screenshots. This was found with build 200707270000, by the way.
Reproducible, but IMHO it is not so serious
I don't know about serious, but it's highly annoying. I happen to use shifting quite often when moving code around with cut&paste, or to indent code before copying it to an e-mail, etc. This defect almost always means I have to fix the indent after pasting, which is tedious.
This will require some extra code to check whether the whole first line is selected and fix the selection after the reformat. BTW format after paste - isn't paste formatted on ctrl-shift-v sufficient?
Please note that pretty much all other text editors have the behavior I described as "expected" here. I just checked Visual Studio, UltraEdit, Vim, Joe, to name a few. Where they differ a bit is in the behavior when the beginning or end of the selection is not at the start of the line (I found Visual Studio's behavior most useful there). Ctrl+Shift+V is not a real solution: - It doesn't help when pasting into a different application. - It doesn't help when pasting into a different file type (for when example pasting code snippets into a changelog or todo file etc.). - It doesn't help when you're working with some code that uses a different formatting convention than the one configured in the options. - It doesn't help when the formatting is more complex than what can be defined with the formatting options (multi-line statements aligned on certain operators, for example). - But most importantly: It's an extra hoop to jump through that is not necessary with other editors I've been working with for the last 15 years or so.
*** Issue 117957 has been marked as a duplicate of this issue. ***
yup. highly annoying.
Resolving all issues with milestone "future" as LATER. If you feel strongly that it should be implemented please reopen and set the target milestone to "next".
NetBeans.org Migration: changing resolution from LATER to WONTFIX
Huh? Why?
@athompson: This is part of the netbeans.org migration, see http://wiki.netbeans.org/NBorgMigration. Reopening.
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue. Thanks for your cooperation, NetBeans IDE 8.2 Release Boss
Still annoyingly relevant.