Commit 75264c9c authored by Thomas Hartmann's avatar Thomas Hartmann

QmlDesigner.Rewriter: Mark area as dirty if text is replaced

The dirty area is used by the indenter and replaced qml code should
be indented.

Change-Id: I8921cb596fc7f8d1e73cf43294d16e9a15d086ec
Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@digia.com>
parent e518074a
......@@ -81,6 +81,7 @@ void ModelNodePositionRecalculator::moved(const TextModifier::MoveInfo &moveInfo
indentOffset = to - prefixLength;
else
indentOffset = to - length - prefixLength - moveInfo.leadingCharsToRemove - moveInfo.trailingCharsToRemove;
m_dirtyAreas.insert(indentOffset, indentLength);
}
......@@ -106,4 +107,5 @@ void ModelNodePositionRecalculator::replaced(int offset, int oldLength, int newL
m_positionStore->setNodeOffset(node, newPosition);
}
}
m_dirtyAreas.insert(offset - newLength + oldLength, newLength);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment