LuaWriter. Now colors Multi-Line Comments.

This commit is contained in:
rolanmen1 2012-07-20 05:36:33 +00:00
parent b2323458ba
commit 6f295fe0c8
1 changed files with 20 additions and 7 deletions

View File

@ -40,6 +40,18 @@ namespace BizHawk.MultiClient
{ {
int endComment; int endComment;
if (LuaText.Text.Substring(CommentMatch.Index, 4) == "--[[")
{
if (LuaText.Find("]]", RichTextBoxFinds.MatchCase) > 0)
endComment = LuaText.SelectionStart - CommentMatch.Index + 2;
else
endComment = LuaText.Text.Length;
LuaText.Select(CommentMatch.Index, endComment);
LuaText.SelectionColor = Color.Green;
}
else
{
if (LuaText.GetLineFromCharIndex(CommentMatch.Index) + 1 == LuaText.Lines.Count()) if (LuaText.GetLineFromCharIndex(CommentMatch.Index) + 1 == LuaText.Lines.Count())
endComment = LuaText.Text.Length - CommentMatch.Index; endComment = LuaText.Text.Length - CommentMatch.Index;
else else
@ -48,6 +60,7 @@ namespace BizHawk.MultiClient
LuaText.Select(CommentMatch.Index, endComment); LuaText.Select(CommentMatch.Index, endComment);
LuaText.SelectionColor = Color.Green; LuaText.SelectionColor = Color.Green;
} }
}
LuaText.Select(selPos, selChars); LuaText.Select(selPos, selChars);
} }