diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index b4648452562bb8011e1b11aa8d75d4a40db881d6..0cf8dbe9c5264e800e61d1d5f00429aee83ba987 100755
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -406,53 +406,58 @@ BOOL LLScriptEdCore::postBuild()
 
 	initMenu();
 
-// Make this work ;-)
-	mSyntaxIdLSL.initialise();
-	// ...
-	mEditor->mKeywords.initialise(mSyntaxIdLSL.getKeywordsXML());
-
-	// FIX: Refactor LLTextEditor::loadKeywords so these can be removed.
-	std::vector<std::string> funcs;
-	std::vector<std::string> tooltips;
-	
-	LLColor3 color(0.5f, 0.0f, 0.15f);
-	mEditor->loadKeywords(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"keywords.ini"), funcs, tooltips, color);
-
-	std::vector<std::string> primary_keywords;
-	std::vector<std::string> secondary_keywords;
-	LLKeywordToken *token;
-	LLKeywords::keyword_iterator_t token_it;
-	for (token_it = mEditor->keywordsBegin(); token_it != mEditor->keywordsEnd(); ++token_it)
-	{
-		token = token_it->second;
-		// FIX: change this to use the new Token Type enum entries.
-		if (token->getColor() == color) // Wow, what a disgusting hack.
-		{
-			primary_keywords.push_back( wstring_to_utf8str(token->getToken()) );
-		}
-		else
+	return initKeywords();
+}
+
+bool LLScriptEdCore::initKeywords()
+{
+	// Make this work ;-)
+		mSyntaxIdLSL.initialise();
+		// ...
+		mEditor->mKeywords.initialise(mSyntaxIdLSL.getKeywordsXML());
+
+		// FIX: Refactor LLTextEditor::loadKeywords so these can be removed.
+		//std::vector<std::string> funcs;
+		//std::vector<std::string> tooltips;
+
+		LLColor3 color(0.5f, 0.0f, 0.15f);
+		mEditor->loadKeywords();
+
+		std::vector<std::string> primary_keywords;
+		std::vector<std::string> secondary_keywords;
+		LLKeywordToken *token;
+		LLKeywords::keyword_iterator_t token_it;
+		for (token_it = mEditor->keywordsBegin(); token_it != mEditor->keywordsEnd(); ++token_it)
 		{
-			secondary_keywords.push_back( wstring_to_utf8str(token->getToken()) );
+			token = token_it->second;
+			// FIX: change this to use the new Token Type enum entries.
+			if (token->getColor() == color) // Wow, what a disgusting hack.
+			{
+				primary_keywords.push_back( wstring_to_utf8str(token->getToken()) );
+			}
+			else
+			{
+				secondary_keywords.push_back( wstring_to_utf8str(token->getToken()) );
+			}
 		}
-	}
 
-	// Case-insensitive dictionary sort for primary keywords. We don't sort the secondary
-	// keywords. They're intelligently grouped in keywords.ini.
-	std::stable_sort( primary_keywords.begin(), primary_keywords.end(), LLSECKeywordCompare() );
+		// Case-insensitive dictionary sort for primary keywords. We don't sort the secondary
+		// keywords. They're intelligently grouped in keywords.ini.
+		std::stable_sort( primary_keywords.begin(), primary_keywords.end(), LLSECKeywordCompare() );
 
-	for (std::vector<std::string>::const_iterator iter= primary_keywords.begin();
-			iter!= primary_keywords.end(); ++iter)
-	{
-		mFunctions->add(*iter);
-	}
+		for (std::vector<std::string>::const_iterator iter= primary_keywords.begin();
+				iter!= primary_keywords.end(); ++iter)
+		{
+			mFunctions->add(*iter);
+		}
 
-	for (std::vector<std::string>::const_iterator iter= secondary_keywords.begin();
-			iter!= secondary_keywords.end(); ++iter)
-	{
-		mFunctions->add(*iter);
-	}
+		for (std::vector<std::string>::const_iterator iter= secondary_keywords.begin();
+				iter!= secondary_keywords.end(); ++iter)
+		{
+			mFunctions->add(*iter);
+		}
 
-	return TRUE;
+		return TRUE;
 }
 
 void LLScriptEdCore::initMenu()
diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h
index 73ccaab0b82769ac8b536184b055fca5051e1bee..bc0256703e01ea3043f33435438aa8159453e212 100755
--- a/indra/newview/llpreviewscript.h
+++ b/indra/newview/llpreviewscript.h
@@ -78,6 +78,7 @@ class LLScriptEdCore : public LLPanel
 	~LLScriptEdCore();
 	
 	void			initMenu();
+	bool			initKeywords();
 
 	virtual void	draw();
 	/*virtual*/	BOOL	postBuild();