Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Commit f806f47

Browse files
Fix for #44
1 parent fb8b717 commit f806f47

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

UI/Components/EditorElement.xaml.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ private async void TextArea_MouseDown(object sender, MouseButtonEventArgs e)
236236
{
237237
var config = Program.Configs[Program.SelectedConfig].SMDirectories.First();
238238
var file = Path.GetFullPath(Path.Combine(config, "include", sm.File)) + ".inc";
239+
await Task.Delay(50);
239240
var result = Program.MainWindow.TryLoadSourceFile(file,
240241
true, false, true);
241242
if (!result)
@@ -248,12 +249,9 @@ private async void TextArea_MouseDown(object sender, MouseButtonEventArgs e)
248249
Debug.Assert(newEditor != null);
249250
newEditor.editor.TextArea.Caret.Offset = sm.Index;
250251
newEditor.editor.TextArea.Caret.BringCaretToView();
251-
await Task.Delay(100);
252252
newEditor.editor.TextArea.Selection =
253253
Selection.Create(newEditor.editor.TextArea, sm.Index, sm.Index + sm.Length);
254254
}
255-
256-
257255
}
258256

259257
private SMBaseDefinition MatchDefinition(SMDefinition smDef, string word, MouseButtonEventArgs e, bool currentFile = false)

0 commit comments

Comments
 (0)