From 6141aa44d0f2aa2662a536c9d3ce9312dd57bd99 Mon Sep 17 00:00:00 2001
From: Cinder <cinder.roxley@phoenixviewer.com>
Date: Mon, 12 May 2014 06:54:04 -0600
Subject: [PATCH] STORM-2027 - Fix syntax highlighting on subsequent opening of
 scripts. This could use more refactoring, but it fixes it.

---
 indra/newview/llpreviewscript.cpp | 8 +++++---
 indra/newview/llpreviewscript.h   | 1 +
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index d83a2bc3a66..b300f3a39c8 100755
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -352,6 +352,7 @@ LLScriptEdCore::LLScriptEdCore(
 	void (*save_callback)(void*, BOOL),
 	void (*search_replace_callback) (void* userdata),
 	void* userdata,
+	bool live,
 	S32 bottom_pad)
 	:
 	LLPanel(),
@@ -366,6 +367,7 @@ LLScriptEdCore::LLScriptEdCore(
 	mLiveHelpHistorySize(0),
 	mEnableSave(FALSE),
 	mLiveFile(NULL),
+	mLive(live),
 	mContainer(container),
 	mHasScriptData(FALSE)
 {
@@ -420,7 +422,7 @@ BOOL LLScriptEdCore::postBuild()
 	}
 	else
 	{
-		LL_DEBUGS("SyntaxLSL") << "Hashes are the same, no need to update highlighter." << LL_ENDL;
+		processKeywords();
 	}
 	mRegionChangedCallback = gAgent.addRegionChangedCallback(boost::bind(&LLScriptEdCore::updateKeywords, this));
 
@@ -1289,8 +1291,8 @@ void* LLPreviewLSL::createScriptEdPanel(void* userdata)
 								   LLPreviewLSL::onSave,
 								   LLPreviewLSL::onSearchReplace,
 								   self,
+								   false,
 								   0);
-	self->mScriptEd->mLive = false;
 	return self->mScriptEd;
 }
 
@@ -1745,8 +1747,8 @@ void* LLLiveLSLEditor::createScriptEdPanel(void* userdata)
 								   &LLLiveLSLEditor::onSave,
 								   &LLLiveLSLEditor::onSearchReplace,
 								   self,
+								   true,
 								   0);
-	self->mScriptEd->mLive = true;
 	return self->mScriptEd;
 }
 
diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h
index 8b98b908e1e..e19a87ec0a2 100755
--- a/indra/newview/llpreviewscript.h
+++ b/indra/newview/llpreviewscript.h
@@ -72,6 +72,7 @@ class LLScriptEdCore : public LLPanel
 		void (*save_callback)(void* userdata, BOOL close_after_save),
 		void (*search_replace_callback)(void* userdata),
 		void* userdata,
+		bool live,
 		S32 bottom_pad = 0);	// pad below bottom row of buttons
 public:
 	~LLScriptEdCore();
-- 
GitLab