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 114539 - Code folding. Inner block expanded instead of outer
Summary: Code folding. Inner block expanded instead of outer
Status: RESOLVED WONTFIX
Alias: None
Product: editor
Classification: Unclassified
Component: Code folding (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P4 blocker (vote)
Assignee: issues@editor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-03 16:27 UTC by Alexander Pepin
Modified: 2009-11-02 11:04 UTC (History)
0 users

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 Alexander Pepin 2007-09-03 16:27:23 UTC
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.
Comment 1 Egor Ushakov 2008-01-24 18:09:03 UTC
This happens only if comment is present after the #endif directive
Comment 2 Egor Ushakov 2008-01-24 18:24:15 UTC
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.
Comment 3 Jan Becicka 2008-02-13 14:21:41 UTC
P4 imo
Comment 4 David Strupl 2009-03-31 15:52:08 UTC
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".
Comment 5 Quality Engineering 2009-11-02 11:04:39 UTC
NetBeans.org Migration: changing resolution from LATER to WONTFIX