Skip to content

Commit ccbb947

Browse files
committed
fixes #62
1 parent af60bcd commit ccbb947

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed
5.32 MB
Binary file not shown.

RevitPythonShell/IronPythonConsole.xaml.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,14 @@ void RunStatements()
117117
// Clear the contents on first click inside the editor
118118
private void textEditor_GotFocus(object sender, RoutedEventArgs e)
119119
{
120-
TextEditor tb = (TextEditor)sender;
121-
tb.Text = string.Empty;
122-
// Remove the handler from the list otherwise this handler will clear
123-
// editor contents every time the editor gains focus.
124-
tb.GotFocus -= textEditor_GotFocus;
120+
if (this.currentFileName == null)
121+
{
122+
TextEditor tb = (TextEditor)sender;
123+
tb.Text = string.Empty;
124+
// Remove the handler from the list otherwise this handler will clear
125+
// editor contents every time the editor gains focus.
126+
tb.GotFocus -= textEditor_GotFocus;
127+
}
125128
}
126129
}
127130
}

0 commit comments

Comments
 (0)