1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Tweaked the internals of CodeDocument::replaceSection so that replacing a section doesn't mess-up the position of CodeDocument::Position objects that are positioned at its start and end.

This commit is contained in:
jules 2013-12-02 23:14:09 +00:00
parent 331ce9ff8c
commit eefbcef611

View file

@ -577,9 +577,8 @@ void CodeDocument::insertText (const int insertIndex, const String& text)
void CodeDocument::replaceSection (const int start, const int end, const String& newText)
{
insertText (start, newText);
const int newTextLen = newText.length();
deleteSection (start + newTextLen, end + newTextLen);
insertText (end, newText);
deleteSection (start, end);
}
void CodeDocument::applyChanges (const String& newContent)