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

Bug 349642

Summary: [client] [textmatestyler] Redraw bug when adding end pattern
Product: [ECD] Orion Reporter: Mark Macdonald <mamacdon>
Component: ClientAssignee: Mark Macdonald <mamacdon>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: bokowski
Version: 0.2Flags: bokowski: review+
Target Milestone: 0.2   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Mark Macdonald CLA 2011-06-17 00:09:03 EDT
1. Create an html file with this content:
> <!--foo
> bar--
> baz

2. Put the caret after the -- on line 2, and type '>' to complete the comment terminator.

3. Expected 'baz' to turn from green to black (since it's no longer inside a comment). But it remains green.

The data structures used by the styler are correct, but the range that is repainted (via TextView.redrawRange()) is not large enough.
Comment 1 Mark Macdonald CLA 2011-06-17 12:56:34 EDT
I have a fix. The reason the tests didn't catch this is because they call textView.onLineStyle() to verify that each line has the correct styles.

This is less brittle that pulling DOM nodes from the TextView and examining their CSS classes (which I was doing in an earlier version of the tests). But, it means that we're not actually inspecting the currently displayed styles, which is where the problem lies in this case.

I will add a testcase for this
Comment 3 Boris Bokowski CLA 2011-06-17 15:05:07 EDT
+1 for RC2, I reviewed the change.