diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index ce5f1bd08264926cccfd19d053593f12d70f1138..7d230f7d42a7a6746aa034deeed32304c59602e0 100644
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -2524,9 +2524,9 @@ void LLTextEditor::loadKeywords(const std::string& filename,
 
 void LLTextEditor::updateSegments()
 {
-	LLFastTimer ft(FTM_SYNTAX_HIGHLIGHTING);
-	if (mKeywords.isLoaded())
+	if (mReflowIndex < S32_MAX && mKeywords.isLoaded())
 	{
+		LLFastTimer ft(FTM_SYNTAX_HIGHLIGHTING);
 		// HACK:  No non-ascii keywords for now
 		segment_vec_t segment_list;
 		mKeywords.findSegments(&segment_list, getWText(), mDefaultColor.get(), *this);