diff --git a/src/dlangide/ui/searchPanel.d b/src/dlangide/ui/searchPanel.d index 784f7d8..15e3026 100644 --- a/src/dlangide/ui/searchPanel.d +++ b/src/dlangide/ui/searchPanel.d @@ -16,6 +16,8 @@ class SearchLogWidget : LogWidget { this(string ID){ super(ID); + scrollLock = false; + } override protected CustomCharProps[] handleCustomLineHighlight(int line, dstring txt, ref CustomCharProps[] buf) { @@ -92,7 +94,8 @@ class SearchWidget : TabWidget { this(string ID, IDEFrame frame) { super(ID); _frame = frame; - + layoutHeight(FILL_PARENT); + //Remove title, more button removeAllChildren(); @@ -115,17 +118,17 @@ class SearchWidget : TabWidget { _resultLog = new SearchLogWidget("SearchLogWidget"); _resultLog.layoutHeight(FILL_PARENT); addChild(_resultLog); - - } void searchInProject(ProjectItem project, ref SearchMatchList[] matchList, dstring text) { - if(project.isFolder) { - foreach(ProjectItem child; cast(ProjectFolder) project) { - searchInProject(child, matchList, text); - } + if(project.isFolder == true) { + ProjectFolder projFolder = cast(ProjectFolder) project; + for(int i = 0; i < projFolder.childCount; i++) { + searchInProject(projFolder.child(i), matchList, text); + } } else { + Log.d("Searching in: " ~ project.filename); EditableContent content = new EditableContent(true); content.load(project.filename); SearchMatchList match; @@ -141,16 +144,21 @@ class SearchWidget : TabWidget { if(match.matches.length > 0) { matchList ~= match; } + } } bool findText(dstring source) { Log.d("Finding " ~ source); + SearchMatchList[] matches; + _resultLog.text = ""d; //TODO Should not crash when in homepage. foreach(Project project; _frame._wsPanel.workspace.projects) { + Log.d("Searching in project " ~ project.filename); searchInProject(project.items, matches, source); + } if(matches.length == 0) { @@ -166,4 +174,4 @@ class SearchWidget : TabWidget { } return true; } -} \ No newline at end of file +} diff --git a/src/dlangide/workspace/project.d b/src/dlangide/workspace/project.d index 825ae76..0faf0d6 100644 --- a/src/dlangide/workspace/project.d +++ b/src/dlangide/workspace/project.d @@ -63,7 +63,7 @@ class ProjectItem { } /// returns true if item is folder - @property bool isFolder() { + @property const bool isFolder() { return false; } /// returns child object count @@ -84,7 +84,7 @@ class ProjectFolder : ProjectItem { super(filename); } - @property override bool isFolder() { + @property override const bool isFolder() { return true; } @property override int childCount() { @@ -135,21 +135,6 @@ class ProjectFolder : ProjectItem { return path; return buildNormalizedPath(_filename, path); } - - int begin; - int end; - bool empty() const { - return begin == _children.count; - } - - void popFront() - { - ++begin; - } - - ProjectItem front() { - return _children[begin]; - } } /// Project source file