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.
Steps to reproduce: - create a new project - create a new C++ header file - insert the following code into the header file: #ifndef _NEWFILE_H #define _NEWFILE_H class A { int a; public: int getVal(); }; class B { int b; public: int getVal(); }; #endif /* _NEWFILE_H */ - collapse class A, class B, then the outer block (including #ifndef ...) - put the cursor at the end of the collapsed statement and call "Code Folds->Expand Fold" from the context menu Result: The cursor moves into the collapsed statement. No fold expands. If you click on the [+] on the left of the folds then you can see that the class B got expanded. This happened while the first attempt to expand the fold.
This happens only if comment is present after the #endif directive
Currently this is a default Netbeans behavior: org.netbeans.editor.ActionFactory has a method getLineFold which looks for nearest Fold using carret position, if all folds are collapsed as we have in this issue, it gets the nearest (class B in our case). Anyway it could have found the nearest using only end position or something like that. Reassigning to Netbeans Editor.
P4 imo
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