From 1335a73d63ac9d051c66f21dba0f0e4f6fcaa033 Mon Sep 17 00:00:00 2001 From: harrybharry Date: Mon, 23 Jun 2008 16:04:35 +0000 Subject: [PATCH] Fix style not enabled if restyle requested on unstyled document. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@249 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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);