When an edit happens in the python shell, remove any line-number marker

This commit is contained in:
baldurk
2016-11-01 19:13:06 +01:00
parent 964a0f6b12
commit f197156ee6
@@ -59,6 +59,7 @@ namespace renderdocui.Windows.Dialogs
((System.ComponentModel.ISupportInitialize)(scriptEditor)).EndInit();
scriptEditor.KeyDown += new KeyEventHandler(scriptEditor_KeyDown);
scriptEditor.TextChanged += new EventHandler(scriptEditor_TextChanged);
newScript.PerformClick();
@@ -80,6 +81,11 @@ namespace renderdocui.Windows.Dialogs
EnableButtons(true);
}
void scriptEditor_TextChanged(object sender, EventArgs e)
{
SetLineNumber(-1);
}
void scriptEditor_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control)
@@ -340,9 +346,16 @@ namespace renderdocui.Windows.Dialogs
}));
}
}
bool recurse = false;
private void SetLineNumber(int lineNum)
{
if (recurse || me == null || me.scriptEditor == null)
return;
recurse = true;
for (int i = 0; i < me.scriptEditor.Lines.Count; i++)
{
me.scriptEditor.Lines[i].DeleteMarker(0);
@@ -352,6 +365,8 @@ namespace renderdocui.Windows.Dialogs
{
me.scriptEditor.Lines[lineNum].AddMarker(0);
}
recurse = false;
}
private void EnableButtons(bool enable)