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 192098 - Since patch 2 Re-indent current line or selection does not work on single line
Summary: Since patch 2 Re-indent current line or selection does not work on single line
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 6.x
Hardware: PC Windows Vista
: P1 normal with 1 vote (vote)
Assignee: Dusan Balek
URL:
Keywords:
: 192024 192043 192119 192162 192264 192574 192604 192607 193288 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-11-18 11:41 UTC by mco
Modified: 2010-12-16 13:54 UTC (History)
11 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Video demonstrating the issue (51.24 KB, application/zip)
2010-12-15 23:34 UTC, ecerichter
Details
NetBeans Messages Log (46.19 KB, application/octet-stream)
2010-12-16 11:51 UTC, ecerichter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mco 2010-11-18 11:41:10 UTC
After installing patch 2 to 6.9.1 re-indent current line or selection action (you need to assign key to it) does not work on single line (no selection, only cursor somewhere in the line).
Also does not work if only some chars in single line are selected.
Works fine if you select at least 2 lines.
Comment 1 Dusan Balek 2010-11-18 15:05:01 UTC
Fixed in jet-main.

http://hg.netbeans.org/jet-main/rev/8f18410ba01c
Comment 2 Dusan Balek 2010-11-19 08:04:35 UTC
*** Bug 192119 has been marked as a duplicate of this bug. ***
Comment 3 Dusan Balek 2010-11-19 09:16:31 UTC
*** Bug 192162 has been marked as a duplicate of this bug. ***
Comment 4 Dusan Balek 2010-11-19 12:20:51 UTC
*** Bug 192043 has been marked as a duplicate of this bug. ***
Comment 5 Marian Mirilovic 2010-11-19 12:57:13 UTC
regression caused by NB 6.9 patch2
Comment 6 Marian Mirilovic 2010-11-19 14:24:43 UTC
*** Bug 192024 has been marked as a duplicate of this bug. ***
Comment 7 marcodave 2010-11-21 13:31:04 UTC
Any hints on how I can get back to the previous behavior ? 
Do I have to install a beta module, or can I simply copy over an older version of the module jar ?
Comment 8 marcodave 2010-11-21 13:40:19 UTC
(In reply to comment #7)
> Any hints on how I can get back to the previous behavior ? 
> Do I have to install a beta module, or can I simply copy over an older version
> of the module jar ?

Maybe I found a possible workaround. If the updates are installed on the local profile (as the default behavior), you can try to rename the file 
$HOME\.netbeans\6.9\modules\org-netbeans-modules-java-source.jar 
to 
$HOME\.netbeans\6.9\modules\org-netbeans-modules-java-source.ja
or something that does not end with "jar". I tried this and it has fallen back to the previous behavior :) now the TAB works as usual. Yay!
Comment 9 Dusan Balek 2010-11-22 11:40:12 UTC
*** Bug 192264 has been marked as a duplicate of this bug. ***
Comment 10 Marian Mirilovic 2010-11-22 12:12:23 UTC
Hmm, start to think about next patch ... give me couple days to prepare it.
Comment 11 Dusan Balek 2010-11-29 08:51:15 UTC
*** Bug 192607 has been marked as a duplicate of this bug. ***
Comment 12 Dusan Balek 2010-11-29 09:07:48 UTC
*** Bug 192604 has been marked as a duplicate of this bug. ***
Comment 13 Marian Mirilovic 2010-11-30 11:57:35 UTC
*** Bug 192574 has been marked as a duplicate of this bug. ***
Comment 14 Marian Mirilovic 2010-12-03 12:46:31 UTC
Dusan,
please transplant fix into clone releases / branch release692, see http://wiki.netbeans.org/NetBeansPatchesProcess#How_to_proceed_with_patch for details by Tuesday 7th of December 2010. Thanks in advance.
Comment 15 Dusan Balek 2010-12-06 12:46:39 UTC
Integrated into releases / branch release692

http://hg.netbeans.org/releases/rev/c5016fd74fc5
Comment 16 Jaromir Uhrik 2010-12-10 13:39:41 UTC
verified in patch3
Comment 17 mjensen 2010-12-10 13:43:41 UTC
It also does not work if the single line starts with //

where as it works fine if the line starts with <space>//

this has been broken for a while
Comment 18 Marian Mirilovic 2010-12-13 11:39:26 UTC
*** Bug 193288 has been marked as a duplicate of this bug. ***
Comment 19 marcodave 2010-12-13 12:26:55 UTC
(In reply to comment #17)
> It also does not work if the single line starts with //
> 
> where as it works fine if the line starts with <space>//
> 
> this has been broken for a while

True. I confirm this annoying behavior. 
If the next patch can fix this too, it would be great!
Comment 20 Dusan Balek 2010-12-13 12:44:05 UTC
FYI, this is as designed behavior that lines starting with // are not indented. It allows users to comment out whole lines of code that should be immutable to subsequent reformat/reindent actions (see sequence of actions: Toggle Comment - Format - Toggle Comment (uncomment)).
Comment 21 mjensen 2010-12-13 19:04:46 UTC
I use the 'emacs' profile for my development, and the emacs behavior is to indent the // even if they are on the first character on a line.

So that is my expected behavior.

Maybe it can be an option somewhere.

Thank you for providing a great IDE for us, and thanks for all your hard work.
Comment 22 Marian Mirilovic 2010-12-14 10:04:03 UTC
NetBeans 6.9/.1 Patch 3 has just been released. Please update your installation to get this issue fixed in your NB installation.
Comment 23 ecerichter 2010-12-15 22:30:55 UTC
It seems that it is not entirely fixed.

Create a method then type the following code:


  for(int i = 0; i < 100; i++) {
    System.out.prinlnt(i); // this line is correctly idented type "enter"
    }|


The last line (with the "}") in above situation, is not correctly idented.

It's supposed to be like this:

  for(int i = 0; i < 100; i++) {
    System.out.prinlnt(i); // this line is correctly idented type "enter"
  }|


This does not happen with plain 6.9.1 version - only with latest path.

Regards,

Edson.
Comment 24 darkestfright 2010-12-15 22:38:51 UTC
When I type that code, the editor automatically inserts the closing brace at the proper location/indentation.  I can't reproduce what you're say.
Comment 25 ecerichter 2010-12-15 23:34:45 UTC
Created attachment 104142 [details]
Video demonstrating the issue

Hi, if the original bracket is kept, it is on the right place.

But the case I'm showing is when you don't have the automatic bracket.

See in the attached video what happens if you delete the automatically inserted bracket and then try to add one your self.

Flash video taken with Debugmode Wink.
Comment 26 Jaromir Uhrik 2010-12-16 11:09:54 UTC
ecerichter, I am not able to reproduce your usecase in 6.9.1 with patch3. Could you please attach your messages.log?
Thanks.
Comment 27 ecerichter 2010-12-16 11:51:47 UTC
Created attachment 104148 [details]
NetBeans Messages Log

Here it is.

In my installation, I've uninstalled several unecessary modules (like EJB, Maven, Spring) to make NetBeans a bit faster.

Maybe I've uninstalled something I should not (but I hope NetBeans track dependencies for me).

Regards,

Edson.
Comment 28 Jaromir Uhrik 2010-12-16 13:30:50 UTC
Thanks for the .log. It is visible there that you have following:	org.netbeans.modules.java.source [0.60.3.10.8.4 10 201011082200]
Which is plugin from patch2 (not patch3) so his version of plugin doesn't contain the fix. The fix is in version 0.60.4.10.8.4 (patch3 version of plugin). So if you want to have this fix just go to Plugin Manager and update Java plugin.
Thanks.
Comment 29 ecerichter 2010-12-16 13:54:34 UTC
Right, for some reason I don't understand, I had no notification about the update.
Actually, I had to "Reload" catalog several times (6 or more) before Netbeans detects the updates. For now, I've up-to-date Java, and it is working as expected. I'll let you know if I face further issues.

Thanks & Regards.