From a92a253481616f4cded2b1fda5ce6944b197df18 Mon Sep 17 00:00:00 2001 From: Zevenberge Date: Sat, 23 Dec 2017 18:26:46 +0100 Subject: [PATCH] The new package also opens and it added to the tree --- src/dlangide/ui/frame.d | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/dlangide/ui/frame.d b/src/dlangide/ui/frame.d index 7476194..459c2f6 100644 --- a/src/dlangide/ui/frame.d +++ b/src/dlangide/ui/frame.d @@ -416,6 +416,13 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL _tabs.renameTab(index, name); } } + + bool tryOpenSourceFile(string filename) { + if (isSupportedSourceTextFileFormat(filename)) { + return openSourceFile(filename, null, true); + } + return false; + } bool openSourceFile(string filename, ProjectSourceFile file = null, bool activate = true) { if (!file && !filename) @@ -1501,9 +1508,7 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL //res.project.reload(); res.project.refresh(); updateTreeGraph(); - if (isSupportedSourceTextFileFormat(res.filename)) { - openSourceFile(res.filename, null, true); - } + tryOpenSourceFile(res.filename); } } }; @@ -1522,6 +1527,10 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL ProjectFolder newFolder = new ProjectFolder(res.filename); if(folder) { folder.addChild(newFolder); + newFolder.refresh(); + if(newFolder.childCount > 0){ + tryOpenSourceFile(newFolder.child(0).filename); + } } updateTreeGraph(); }