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 244615 - regression: broken Toggle Comment
Summary: regression: broken Toggle Comment
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Actions/Menu/Toolbar (show other bugs)
Version: 7.2
Hardware: PC Linux
: P1 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-21 04:38 UTC by Vladimir Voskresensky
Modified: 2014-05-28 02:39 UTC (History)
2 users (show)

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 Vladimir Voskresensky 2014-05-21 04:38:59 UTC
when I have code:
-----------
//<editor-fold defaultstate="collapsed" desc="foo">
void foo() {
....
}
//</editor-fold>

//<editor-fold defaultstate="collapsed" desc="boo">
void boo() {
....
}
//</editor-fold>
-------------
If I select this two functions with their folding wrappers and use Toggle comment, last week it worked just fine:
////<editor-fold defaultstate="collapsed" desc="foo">
//void foo() {
//....
//}
////</editor-fold>
//
////<editor-fold defaultstate="collapsed" desc="boo">
//void boo() {
//....
//}
////</editor-fold>
Now it is full crap:
<editor-fold defaultstate="collapsed" desc="foo">
//void foo() {
//....
//}
</editor-fold>
//
<editor-fold defaultstate="collapsed" desc="boo">
//void boo() {
//....
//}
</editor-fold>

Please fix it
Comment 1 Vladimir Voskresensky 2014-05-26 08:02:46 UTC
Looks like the side effect of 
http://hg.netbeans.org/main-silver/rev/7f2af9990520

Please, backout this change. It modifies behavior too much.
Comment 2 Vladimir Voskresensky 2014-05-26 09:09:55 UTC
I can not comment out functions which have line comments:

void foo() [
    // comment 
    int a = 10;
}

It became:
//void foo() [
     comment 
//    int a = 10;
//}
Comment 3 Dusan Balek 2014-05-26 11:12:43 UTC
Perhaps only the line comments starting at line beginnings should be removed by the Toggle Comment Action. Vladimir, would it work for you as a sufficient tradeoff between the old behavior and the behavior requested by #168430? Thanks.
Comment 4 Ralph Ruijs 2014-05-26 11:31:31 UTC
(In reply to Dusan Balek from comment #3)
> Perhaps only the line comments starting at line beginnings should be removed
> by the Toggle Comment Action. Vladimir, would it work for you as a
> sufficient tradeoff between the old behavior and the behavior requested by
> #168430? Thanks.

Are we sure the requested behavior in #168430 is something that we want? Personally I really do not like the proposed behavior and would probably be very annoyed when this hits the next release.

If this has to be implemented, please make it configurable with a default for the old behavior.

Thanks!
Comment 5 Vladimir Voskresensky 2014-05-26 12:36:59 UTC
(In reply to Dusan Balek from comment #3)
> Perhaps only the line comments starting at line beginnings should be removed
> by the Toggle Comment Action. Vladimir, would it work for you as a
> sufficient tradeoff between the old behavior and the behavior requested by
> #168430? Thanks.
I think it will not work, because of the case #1:
//<editor-fold defaultstate="collapsed" desc="foo">
void foo() {
....
}
//</editor-fold>

when I have collapsed fold and would like to comment out whole content I just pressed Ctrl+/
but folding marker has leading "//" => it must not be erased
Comment 6 Dusan Balek 2014-05-26 15:37:14 UTC
OK - patch for #168430 reverted.

http://hg.netbeans.org/jet-main/rev/c6ed70327131
Comment 7 Vladimir Voskresensky 2014-05-26 18:33:54 UTC
thank you!
Comment 8 Quality Engineering 2014-05-28 02:39:45 UTC
Integrated into 'main-silver', will be available in build *201405280001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/c6ed70327131
User: Dusan Balek <dbalek@netbeans.org>
Log: Issue #244615 - regression: broken Toggle Comment - fixed. Patch for ##168430 reverted.