LuaWriter. It will now color black unmatches in the text. Also fixed a bug that randomly selects a small block of text.

This commit is contained in:
rolanmen1 2012-07-19 19:58:27 +00:00
parent 2e71b04de4
commit 4b3971a997
2 changed files with 10 additions and 7 deletions

View File

@ -117,9 +117,6 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="StatusSlot0.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="StatusSlot0.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>126, 17</value> <value>126, 17</value>
</metadata> </metadata>
@ -127,6 +124,6 @@
<value>236, 17</value> <value>236, 17</value>
</metadata> </metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>30</value> <value>43</value>
</metadata> </metadata>
</root> </root>

View File

@ -21,14 +21,20 @@ namespace BizHawk.MultiClient
private void timer_Tick(object sender, EventArgs e) private void timer_Tick(object sender, EventArgs e)
{ {
int selPos = LuaText.SelectionStart; int selPos = LuaText.SelectionStart;
int selChars = LuaText.SelectedText.Length;
int curPos = 0;
foreach (Match keyWordMatch in keyWords.Matches(LuaText.Text)) foreach (Match keyWordMatch in keyWords.Matches(LuaText.Text))
{ {
LuaText.Select(curPos, keyWordMatch.Index);
LuaText.SelectionColor = Color.Black;
LuaText.Select(keyWordMatch.Index, keyWordMatch.Length); LuaText.Select(keyWordMatch.Index, keyWordMatch.Length);
LuaText.SelectionColor = Color.Blue; LuaText.SelectionColor = Color.Blue;
LuaText.SelectionStart = selPos; curPos = keyWordMatch.Index + keyWordMatch.Length;
LuaText.SelectionColor = Color.Black;
} }
LuaText.Select(curPos, selPos);
LuaText.SelectionColor = Color.Black;
LuaText.Select(selPos, selChars);
} }
} }