| Summary: | [typing] problems deleting line while in "selected element only" mode | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Rafael Chaves <eclipse> |
| Component: | Text | Assignee: | Tom Hofmann <eclipse> |
| Status: | VERIFIED FIXED | QA Contact: | |
| Severity: | major | ||
| Priority: | P2 | ||
| Version: | 3.2 | ||
| Target Milestone: | 3.2 RC1 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
Forgot the stack trace: !ENTRY org.eclipse.ui 4 0 2006-04-05 15:19:15.390 !MESSAGE overlaps with existing fragment !STACK 0 java.lang.IllegalArgumentException: overlaps with existing fragment at org.eclipse.jface.text.projection.ProjectionDocument.internalAddMasterDocumentRange(ProjectionDocument.java:286) at org.eclipse.jface.text.projection.ProjectionDocument.addMasterDocumentRange(ProjectionDocument.java:559) at org.eclipse.jface.text.projection.ProjectionDocument.adaptProjectionToMasterChange(ProjectionDocument.java:741) at org.eclipse.jface.text.projection.ProjectionDocument.masterDocumentAboutToBeChanged(ProjectionDocument.java:775) at org.eclipse.jface.text.projection.ProjectionDocumentManager.fireDocumentEvent(ProjectionDocumentManager.java:121) at org.eclipse.jface.text.projection.ProjectionDocumentManager.documentAboutToBeChanged(ProjectionDocumentManager.java:138) at org.eclipse.jface.text.AbstractDocument.fireDocumentAboutToBeChanged(AbstractDocument.java:623) at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1103) at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:151) at org.eclipse.jface.text.AbstractDocument.replace(AbstractDocument.java:1119) at org.eclipse.core.internal.filebuffers.SynchronizableDocument.replace(SynchronizableDocument.java:137) at org.eclipse.ui.texteditor.DeleteLineTarget.deleteLine(DeleteLineTarget.java:357) at org.eclipse.ui.texteditor.DeleteLineAction.run(DeleteLineAction.java:151) ... Great! We were looking for a test case for this IAE for quite some time. See also bug 134227. Not the same as bug 134227. This bug is caused by ProjectionDocument::internalAddMasterDocumentRange which did not account for a visible fragment of length zero. Fixed > 20060407 Tom, does this fix problem #2 as well (blindly deleting lines from the next element)? If not, is there a PR for that? (In reply to comment #4) > Tom, does this fix problem #2 as well (blindly deleting lines from the next > element)? If not, is there a PR for that? 2 x No - would you file a separate PR? Not sure whether we will be able to do this for 3.2, though. Ok. Opened bug 135563. verified in 20060426 |
M5 Having the "Show Source of Selected Element Only" option enabled, I saw two different problems when deleting lines using Ctrl-D to delete the last line of the element: 1) sometimes I get an "java.lang.IllegalArgumentException: overlaps with existing fragment" 2) otherwise, Ctrl-d will allow me to happily allow me to blindly delete lines from the elements below the one I was editing without even giving me much of a clue that I was doing that. I would expect that the editor would restrict to editing the contents of that element only. Here is the Java source I used to reproduce the problem: public class Test { /* this is a test*/ private int var2 = 0; private int var1 = 0; public static void main(String[] args) { System.out.println("Hello"); } } Try positioning the cursor at the end of var1 (not sure it matters) and press Ctrl-D twice.