| Summary: | [implementation][projection] cannot set visible region length=0 in editor | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Amy Wu <for.work.things> |
| Component: | Text | Assignee: | Platform-Text-Inbox <platform-text-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | daniel_megert, david_williams |
| Version: | 3.0 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
|
Description
Amy Wu
+1 any chance this bug could be fixed for 3.0.1? Otherwise, is there some sort of easy workaround? FYI, I have a workaround for this problem. I basically add a " " before I
setvisibleregion and then I delete the " " right after I set the visible
region. So it essentially looks a little something like:
boolean usedWorkaround = false;
if (visibleRegion.getLength == 0) {
// add " " to document
// visibleRegion.length = 1
// usedWorkaround = true;
}
TextViewer.setVisibleRegion(visibleRegion)
if (usedWorkaround) {
// delete " " that was added
}
One side effect I know of is that I do actually have to modify my document in
the workaround, so my file is marked dirty.
I have code released to HEAD (i.e. 3.1) solving the problem. The corresponding test is SegmentedModeTest in org.eclipse.ui.editors.tests. We'll run with that for a while to find potential side effects not caught by the test suites. If this looks OK, the fix will go into 3.0.1 if you still think you need it. Yes, if the fix is good and can be included in 3.0.1, I would prefer to use the real fix instead of the workaround. Thanks. This got fixed long time ago. |