diff --git a/indra/llui/llkeywords.cpp b/indra/llui/llkeywords.cpp
index e2ffd30f8d53e5e46f823846cd76218827172010..07c84e57c07481bb286c0fd1a88cdf4d6e1b5457 100755
--- a/indra/llui/llkeywords.cpp
+++ b/indra/llui/llkeywords.cpp
@@ -89,7 +89,7 @@ void LLKeywords::addColorGroup(const std::string key_in, const LLColor4 color)
 }
 
 // Add the token as described
-void LLKeywords::addToken(LLKeywordToken::TOKEN_TYPE type,
+void LLKeywords::addToken(LLKeywordToken::ETokenType type,
 						  const std::string& key_in,
 						  const LLColor4& color,
 						  const std::string& tool_tip_in,
@@ -300,7 +300,7 @@ void LLKeywords::processTokensGroup(LLSD& Tokens, const std::string Group)
 	LLColor4 ColorDeprecated = getColorGroup("deprecated");
 	LLColor4 ColorGM = getColorGroup("god-mode");
 
-	LLKeywordToken::TOKEN_TYPE token_type = LLKeywordToken::TT_UNKNOWN;
+	LLKeywordToken::ETokenType token_type = LLKeywordToken::TT_UNKNOWN;
 	// If a new token type is added here, it must also be added to the 'addToken' method
 	if (Group == "constants")
 	{
@@ -633,7 +633,7 @@ void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLW
 					seg_start = cur - base;
 					cur += cur_delimiter->getLengthHead();
 
-					LLKeywordToken::TOKEN_TYPE type = cur_delimiter->getType();
+					LLKeywordToken::ETokenType type = cur_delimiter->getType();
 					if( type == LLKeywordToken::TT_TWO_SIDED_DELIMITER || type == LLKeywordToken::TT_DOUBLE_QUOTATION_MARKS )
 					{
 						while( *cur && !cur_delimiter->isTail(cur))
diff --git a/indra/llui/llkeywords.h b/indra/llui/llkeywords.h
index 2f7932f815b2fbc724cd6e5906dea6e6588e75f5..69bc8919db9f6d5737f2a8c9cc4cc42a952974af 100755
--- a/indra/llui/llkeywords.h
+++ b/indra/llui/llkeywords.h
@@ -53,7 +53,7 @@ class LLKeywordToken
 	 * - TT_TWO_SIDED_DELIMITER are for delimiters that end with a different delimiter than they open with.
 	 * - TT_DOUBLE_QUOTATION_MARKS are for delimiting areas using the same delimiter to open and close.
 	 */
-	enum TOKEN_TYPE
+	typedef enum e_token_type
 	{
 		TT_UNKNOWN,
 		TT_WORD,
@@ -69,9 +69,9 @@ class LLKeywordToken
 		TT_LABEL,							// LINE
 		TT_SECTION,							// WORD
 		TT_TYPE								// WORD
-	};
+	} ETokenType;
 
-	LLKeywordToken( TOKEN_TYPE type, const LLColor4& color, const LLWString& token, const LLWString& tool_tip, const LLWString& delimiter  )
+	LLKeywordToken( ETokenType type, const LLColor4& color, const LLWString& token, const LLWString& tool_tip, const LLWString& delimiter  )
 		:
 		mType( type ),
 		mToken( token ),
@@ -87,7 +87,7 @@ class LLKeywordToken
 	bool				isTail(const llwchar* s) const;
 	const LLWString&	getToken() const		{ return mToken; }
 	const LLColor4&		getColor() const		{ return mColor; }
-	TOKEN_TYPE			getType()  const		{ return mType; }
+	ETokenType			getType()  const		{ return mType; }
 	const LLWString&	getToolTip() const		{ return mToolTip; }
 	const LLWString&	getDelimiter() const	{ return mDelimiter; }
 
@@ -96,7 +96,7 @@ class LLKeywordToken
 #endif
 
 private:
-	TOKEN_TYPE	mType;
+	ETokenType	mType;
 	LLWString	mToken;
 	LLColor4	mColor;
 	LLWString	mToolTip;
@@ -119,7 +119,7 @@ class LLKeywords
 	void		processTokens();
 
 	// Add the token as described
-	void addToken(LLKeywordToken::TOKEN_TYPE type,
+	void addToken(LLKeywordToken::ETokenType type,
 					const std::string& key,
 					const LLColor4& color,
 					const std::string& tool_tip = LLStringUtil::null,
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index 8120f3f9a1dcf21b7bb90a74b1426097f7211693..b18c545f304765f0e1834728554f631cabe7cd3e 100755
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -2511,43 +2511,6 @@ BOOL LLTextEditor::tryToRevertToPristineState()
 	return isPristine(); // TRUE => success
 }
 
-
-static LLFastTimer::DeclareTimer FTM_SYNTAX_HIGHLIGHTING("Syntax Highlighting");
-void LLTextEditor::loadKeywords()
-{
-	LLFastTimer ft(FTM_SYNTAX_HIGHLIGHTING);
-	mKeywords.processTokens();
-
-	segment_vec_t segment_list;
-	mKeywords.findSegments(&segment_list, getWText(), mDefaultColor.get(), *this);
-
-	mSegments.clear();
-	segment_set_t::iterator insert_it = mSegments.begin();
-	for (segment_vec_t::iterator list_it = segment_list.begin(); list_it != segment_list.end(); ++list_it)
-	{
-		insert_it = mSegments.insert(insert_it, *list_it);
-	}
-}
-
-void LLTextEditor::updateSegments()
-{
-	if (mReflowIndex < S32_MAX && mKeywords.isLoaded() && mParseOnTheFly)
-	{
-		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);
-
-		clearSegments();
-		for (segment_vec_t::iterator list_it = segment_list.begin(); list_it != segment_list.end(); ++list_it)
-		{
-			insertSegment(*list_it);
-		}
-	}
-
-	LLTextBase::updateSegments();
-}
-
 void LLTextEditor::updateLinkSegments()
 {
 	LLWString wtext = getWText();
diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h
index 09c56fca5a83692c6f3e7170e165290ec2e583ea..6c14ad90a5629709fe60bdce5b0fa4b7bd488b89 100755
--- a/indra/llui/lltexteditor.h
+++ b/indra/llui/lltexteditor.h
@@ -30,7 +30,6 @@
 #define LL_LLTEXTEDITOR_H
 
 #include "llrect.h"
-#include "llkeywords.h"
 #include "llframetimer.h"
 #include "lldarray.h"
 #include "llstyle.h"
@@ -45,7 +44,6 @@
 
 class LLFontGL;
 class LLScrollbar;
-class LLKeywordToken;
 class TextCmd;
 class LLUICtrlFactory;
 class LLScrollContainer;
@@ -188,14 +186,6 @@ class LLTextEditor :
 
 	void			getCurrentLineAndColumn( S32* line, S32* col, BOOL include_wordwrap );
 
-	LLKeywords		mKeywords;
-	void			loadKeywords();
-	LLKeywords::keyword_iterator_t keywordsBegin()	{ return mKeywords.begin(); }
-	LLKeywords::keyword_iterator_t keywordsEnd()	{ return mKeywords.end(); }
-
-	void			loadKeywords(const std::string& filename_keywords,
-								const std::string& filename_colors);
-
 	// Hacky methods to make it into a word-wrapping, potentially scrolling,
 	// read-only text box.
 	void			setCommitOnFocusLost(BOOL b)			{ mCommitOnFocusLost = b; }
@@ -293,8 +283,8 @@ class LLTextEditor :
 
 	BOOL				mShowLineNumbers;
 	bool				mAutoIndent;
+	bool				mParseOnTheFly;
 
-	/*virtual*/ void	updateSegments();
 	void				updateLinkSegments();
 
 private:
@@ -331,7 +321,6 @@ class LLTextEditor :
 
 	BOOL			mAllowEmbeddedItems;
 	bool			mShowContextMenu;
-	bool			mParseOnTheFly;
 	bool			mEnableTooltipPaste;
 	bool			mPassDelete;
 
@@ -351,4 +340,4 @@ extern template class LLTextEditor* LLView::getChild<class LLTextEditor>(
 	const std::string& name, BOOL recurse) const;
 #endif
 
-#endif  // LL_TEXTEDITOR_
+#endif  // LL_TEXTEDITOR_H
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index 0d95874406c263c93d5df787248fe6d1824cc224..e778015965f0454a8658bae9927c4c637cb5e11c 100755
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -472,8 +472,7 @@ void LLScriptEdCore::processKeywords()
 
 		if (mSyntaxIdLSL.isLoaded())
 		{
-			mEditor->mKeywords.initialise(mSyntaxIdLSL.getKeywordsXML());
-
+			mEditor->initKeywords();
 			mEditor->loadKeywords();
 
 			std::vector<std::string> primary_keywords;
diff --git a/indra/newview/llscripteditor.cpp b/indra/newview/llscripteditor.cpp
index 67a43c0ef092bae10396c8e36136549bd7102e9e..61b5eec9fc922fa323363f40977b2ac90be68072 100644
--- a/indra/newview/llscripteditor.cpp
+++ b/indra/newview/llscripteditor.cpp
@@ -28,6 +28,8 @@
 #include "linden_common.h"
 #include "llscripteditor.h"
 
+#include "llsyntaxid.h"
+
 static LLDefaultChildRegistry::Register<LLScriptEditor> r("script_editor");
 
 LLScriptEditor::LLScriptEditor::Params::Params()
@@ -42,6 +44,48 @@ LLScriptEditor::LLScriptEditor(const Params& p)
 	
 }
 
+void LLScriptEditor::initKeywords()
+{
+	mKeywords.initialise(LLSyntaxIdLSL::getInstance()->getKeywordsXML());
+}
+
+static LLFastTimer::DeclareTimer FTM_SYNTAX_HIGHLIGHTING("Syntax Highlighting");
+
+void LLScriptEditor::loadKeywords()
+{
+	LLFastTimer ft(FTM_SYNTAX_HIGHLIGHTING);
+	mKeywords.processTokens();
+	
+	segment_vec_t segment_list;
+	mKeywords.findSegments(&segment_list, getWText(), mDefaultColor.get(), *this);
+	
+	mSegments.clear();
+	segment_set_t::iterator insert_it = mSegments.begin();
+	for (segment_vec_t::iterator list_it = segment_list.begin(); list_it != segment_list.end(); ++list_it)
+	{
+		insert_it = mSegments.insert(insert_it, *list_it);
+	}
+}
+
+void LLScriptEditor::updateSegments()
+{
+	if (mReflowIndex < S32_MAX && mKeywords.isLoaded() && mParseOnTheFly)
+	{
+		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);
+		
+		clearSegments();
+		for (segment_vec_t::iterator list_it = segment_list.begin(); list_it != segment_list.end(); ++list_it)
+		{
+			insertSegment(*list_it);
+		}
+	}
+	
+	LLTextBase::updateSegments();
+}
+
 void LLScriptEditor::clearSegments()
 {
 	if (!mSegments.empty())
diff --git a/indra/newview/llscripteditor.h b/indra/newview/llscripteditor.h
index a0bee36a25790d7a7bef78aaa1d5f8bf9172374a..86c915d6a0a4284e84b1594603abccb642be5904 100644
--- a/indra/newview/llscripteditor.h
+++ b/indra/newview/llscripteditor.h
@@ -41,11 +41,21 @@ class LLScriptEditor : public LLTextEditor
 	};
 	
 	virtual ~LLScriptEditor() {};
-	void clearSegments();
+	void	initKeywords();
+	void	loadKeywords();
+	void	clearSegments();
+	LLKeywords::keyword_iterator_t keywordsBegin()	{ return mKeywords.begin(); }
+	LLKeywords::keyword_iterator_t keywordsEnd()	{ return mKeywords.end(); }
 	
 protected:
 	LLScriptEditor(const Params& p);
-
+	
+private:
+	void	updateSegments();
+	void	loadKeywords(const std::string& filename_keywords,
+						 const std::string& filename_colors);
+	
+	LLKeywords	mKeywords;
 };
 
 #endif // LL_SCRIPTEDITOR_H
diff --git a/indra/newview/skins/default/xui/en/floater_region_debug_console.xml b/indra/newview/skins/default/xui/en/floater_region_debug_console.xml
index 99b812a880720be5633a4a5e4a9a1ea0e43d2372..11172d8a3e25edb8844def4752041b3c44045897 100755
--- a/indra/newview/skins/default/xui/en/floater_region_debug_console.xml
+++ b/indra/newview/skins/default/xui/en/floater_region_debug_console.xml
@@ -21,7 +21,6 @@
     layout="topleft"
     max_length="65536"
     name="region_debug_console_output"
-    show_line_numbers="false" 
     word_wrap="true"
     track_end="true"
     read_only="true">
diff --git a/indra/newview/skins/default/xui/en/panel_script_ed.xml b/indra/newview/skins/default/xui/en/panel_script_ed.xml
index 3e88e2dc04fe24b44c90052ba00c9dc37d3c4af8..1a4f0aff73119859aae3ee4d30136d77b51b520d 100755
--- a/indra/newview/skins/default/xui/en/panel_script_ed.xml
+++ b/indra/newview/skins/default/xui/en/panel_script_ed.xml
@@ -161,7 +161,6 @@
      name="Script Editor"
      text_readonly_color="DkGray"
      width="487"
-     show_line_numbers="true" 
      enable_tooltip_paste="true"
      word_wrap="true">
         Loading...
diff --git a/indra/newview/skins/default/xui/en/script_editor.xml b/indra/newview/skins/default/xui/en/script_editor.xml
index d24833e85c9c97bcd76e1e901d1d543bc2cc98a2..b030a117fc5359e91c19f61d7d3bce039091ad40 100644
--- a/indra/newview/skins/default/xui/en/script_editor.xml
+++ b/indra/newview/skins/default/xui/en/script_editor.xml
@@ -1,5 +1,7 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
 <script_editor
     name="script_editor"
-    parse_urls="false">
+    parse_urls="false"
+	show_context_menu="true"
+	show_line_numbers="true">
 </script_editor>