From d1144ac3f5418b2ecac0380d8090bd7d6b95f3dc Mon Sep 17 00:00:00 2001 From: Vadim Lopatin Date: Fri, 22 Sep 2017 12:25:25 +0300 Subject: [PATCH] fix duplicate doc comment popups - fix #321 --- src/dlangide/ui/dsourceedit.d | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/dlangide/ui/dsourceedit.d b/src/dlangide/ui/dsourceedit.d index d725a8b..185bf41 100644 --- a/src/dlangide/ui/dsourceedit.d +++ b/src/dlangide/ui/dsourceedit.d @@ -3,6 +3,7 @@ module dlangide.ui.dsourceedit; import dlangui.core.logger; import dlangui.core.signals; import dlangui.graphics.drawbuf; +import dlangui.widgets.widget; import dlangui.widgets.editors; import dlangui.widgets.srcedit; import dlangui.widgets.menu; @@ -489,8 +490,28 @@ class DSourceEdit : SourceEdit, EditableContentMarksChangeListener { }); } + /// returns widget visibility (Visible, Invisible, Gone) + override @property Visibility visibility() { return super.visibility; } + /// sets widget visibility (Visible, Invisible, Gone) + override @property Widget visibility(Visibility visible) { + super.visibility(visible); + if (visible != Visibility.Visible) + cancelEditorToolTasks(); + return this; + } + + void cancelEditorToolTasks() { + if (editorTool) { + editorTool.cancelGoToDefinition(); + editorTool.cancelGetDocComments(); + editorTool.cancelGetCompletions(); + } + } + PopupWidget _docsPopup; void showDocCommentsPopup(string[] comments, Point pt = Point(-1, -1)) { + if (!visible) + return; if (comments.length == 0) return; if (pt.x < 0 || pt.y < 0) {