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 144385

Summary: Folding blocks with some scenarios (collapsed fold on same line)
Product: editor Reporter: emi <emi>
Component: Code foldingAssignee: issues@editor <issues>
Status: RESOLVED DUPLICATE    
Severity: blocker    
Priority: P2    
Version: 6.x   
Hardware: Macintosh (x86)   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: The final state of the locked fold, when only "four" can be toggled. The rest are blocked.

Description emi 2008-08-19 12:48:54 UTC
I've noticed this bug with HTML. Try this example:

<html>
    <p>one
    </p><p>two
    </p><p>three
    </p><p>four
    </p>
    
</html>
    
You'll notice that if you keep pressing on the fold button next to the "one" text the folding will block and you won't
be able to un-collapse the folds one, two and three. Only fold "four" will collapse/un-collapse. See attached screenshot.

The problem lies in the CodeFoldingSideBar.performAction(Mark) method, where it picks the last fold on the line in order
to toggle it. The bug is that if there are collapse folds before the last fold, those folds will forever be collapsed.
The only solution is the reopen the file or clone the editor.
Comment 1 emi 2008-08-19 12:49:41 UTC
Created attachment 67799 [details]
The final state of the locked fold, when only "four" can be toggled. The rest are blocked.
Comment 2 Petr Dvorak 2008-08-19 16:09:17 UTC
Hi! This is a known issue and I don't think this is a P2 as a simple workaround exists - when you dbl-click the fold
"{...}" in the editor, fold is normally expanded. I believe this works the same way as for example in MS Visual Studio...

*** This issue has been marked as a duplicate of 89955 ***
Comment 3 emi 2008-08-19 16:16:56 UTC
Fine by me. I didn't know that double-clicking the fold expands it back.