mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
range marker exception
This commit is contained in:
+5
-3
@@ -32,16 +32,18 @@ public class PersistentLineMarker extends RangeMarkerImpl {
|
||||
public void documentChanged(DocumentEvent e) {
|
||||
if (!isValid()) return;
|
||||
|
||||
DocumentEventImpl event = (DocumentEventImpl) e;
|
||||
DocumentEventImpl event = (DocumentEventImpl)e;
|
||||
if (event.isWholeTextReplaced()) {
|
||||
myLine = event.translateLineViaDiff(myLine);
|
||||
if (myLine < 0 || myLine >= getDocument().getLineCount()) {
|
||||
invalidate();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
myStart = MarkupModelImpl.getFirstNonspaceCharOffset(getDocument(), myLine);
|
||||
myEnd = myStart;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
super.documentChanged(e);
|
||||
if (isValid()) {
|
||||
myLine = getDocument().getLineNumber(myStart);
|
||||
|
||||
@@ -65,6 +65,9 @@ public class PersistentRangeMarker extends RangeMarkerImpl {
|
||||
else{
|
||||
myEnd = getDocument().getLineStartOffset(myEndLine) + myEndColumn;
|
||||
}
|
||||
if (myEnd < myStart) {
|
||||
invalidate();
|
||||
}
|
||||
}
|
||||
else{
|
||||
super.documentChanged(e);
|
||||
|
||||
Reference in New Issue
Block a user