Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 275425

Summary: ProjectionViewer unnecessarily expands folded regions
Product: [Eclipse Project] Platform Reporter: Anton Leherbauer <aleherb+eclipse>
Component: TextAssignee: Platform-Text-Inbox <platform-text-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert
Version: 3.5   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Anton Leherbauer CLA 2009-05-08 04:00:41 EDT
When deleting multiple lines of text, subsequent folded regions might get expanded.

E.g.

public class Foo {
    static void m1() {
        // delete me
        // delete me
        // delete me
        // delete me
        // delete me
        // delete me
    }
    static void m2() {
        // fold me
    }
    static void m3() {
        // fold me
    }
    static void m4() {
        // fold me
    }
}

Fold methods m2-m4 and then delete the comments in m1. Methods m2-m4 get expanded.

The culprit seems to be ProjectionViewer.handleVisibleDocumentChanged() where in case of a delete with multiple lines, the complete range of the (now deleted) text is expanded.
Comment 1 Dani Megert CLA 2009-05-08 04:04:02 EDT

*** This bug has been marked as a duplicate of bug 178203 ***