diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp index ae7f12e47..67d91b791 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp @@ -1014,10 +1014,10 @@ void ScintillaEditView::restoreCurrentPos() scroll(0, lineToShow); } -//! \brief this method activates the doc and the corresponding sub tab -//! \brief return the index of previeus current doc void ScintillaEditView::restyleBuffer() { int end = execute(SCI_GETENDSTYLED); //style up to the last styled byte. + if (end == 0) + return; execute(SCI_CLEARDOCUMENTSTYLE); execute(SCI_COLOURISE, 0, end); _currentBuffer->setNeedsLexing(false);