Korrektur der Ersetzung.

This commit is contained in:
michael 2019-12-02 15:38:31 +01:00
parent e241b423a3
commit 6b87eb7d4f

View File

@ -256,7 +256,6 @@ public class JavEditor extends TextEditor implements UnifyResultListener {
// Add extra offset for the additional insert points of "typeReplaceMarker"
// to "toCheck"
// ...
/*
for (TypeInsertPoint additionalPoint : typeReplaceMarker.getInsertPoint().getAdditionalPointsUnsorted()) {
int lengthAdditionalInsert = additionalPoint.getInsertString().length();
int positionAdditionalInsert = additionalPoint.getPositionInCode();
@ -265,13 +264,12 @@ public class JavEditor extends TextEditor implements UnifyResultListener {
toCheck.getInsertPoint().point.addExtraOffset(lengthAdditionalInsert);
}
}
*/
for (TypeInsertPoint tip : typeReplaceMarker.getInsertPoint().getAdditionalPointsUnsorted()) {
// Add to all other type replace markers the extra offsets of the additional
// points of this type replace marker.
// ...
if (toCheck.getPoint().getPositionInCode() > postitionOfInsert - tip.getInsertString().length()) {
if (toCheck.getPoint().getPositionInCode() > tip.getPositionInCode()) {
toCheck.getInsertPoint().point.addExtraOffset(tip.getInsertString().length());
}
}
@ -285,7 +283,7 @@ public class JavEditor extends TextEditor implements UnifyResultListener {
int lengthAdditionalInsert = additionalPoint.getInsertString().length();
int positionAdditionalInsert = additionalPoint.getPositionInCode();
if (positionAdditionalInsert + lengthAdditionalInsert < toCheckAddi.getPositionInCode() ) {
if (toCheckAddi.getPositionInCode() > positionAdditionalInsert) {
toCheckAddi.addExtraOffset(lengthAdditionalInsert);
}
}