mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
When an edit happens in the python shell, remove any line-number marker
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user