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

Made CodeDocument:: replaceAllContent apply a diff of only the changed regions.

This commit is contained in:
jules 2012-08-15 23:13:18 +01:00
parent 9caac6d44e
commit 85e5fae0fd
2 changed files with 14 additions and 7 deletions

View file

@ -38,6 +38,7 @@ CodeDocument& SourceCodeDocument::getCodeDocument()
{
codeDoc = new CodeDocument();
reloadInternal();
codeDoc->clearUndoHistory();
}
return *codeDoc;
@ -61,11 +62,8 @@ void SourceCodeDocument::reloadInternal()
{
jassert (codeDoc != nullptr);
modDetector.updateHash();
ScopedPointer <InputStream> in (modDetector.getFile().createInputStream());
if (in != nullptr)
codeDoc->loadFromStream (*in);
codeDoc->replaceAllContent (modDetector.getFile().loadFileAsString());
codeDoc->setSavePoint();
}
bool SourceCodeDocument::save()