From 66c7e286390b7614ee04b99a3f9799f4085d296a Mon Sep 17 00:00:00 2001 From: Vadim Lopatin Date: Tue, 26 Jan 2016 10:04:59 +0300 Subject: [PATCH] goToDefinition by Ctrl+Click - close #111 --- dub.json | 2 +- src/dlangide/tools/d/deditortool.d | 2 +- src/dlangide/ui/dsourceedit.d | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dub.json b/dub.json index 5afd5f7..09dd213 100644 --- a/dub.json +++ b/dub.json @@ -12,7 +12,7 @@ "stringImportPaths": ["views", "views/res", "views/res/i18n", "views/res/mdpi", "views/res/hdpi"], "dependencies": { - "dlangui": "~>0.7.50", + "dlangui": "~>0.7.51", "dcd": "~>0.7.5" }, diff --git a/src/dlangide/tools/d/deditortool.d b/src/dlangide/tools/d/deditortool.d index e160cff..17d338a 100644 --- a/src/dlangide/tools/d/deditortool.d +++ b/src/dlangide/tools/d/deditortool.d @@ -53,7 +53,7 @@ class DEditorTool : EditorTool } auto target = to!int(output.offset); auto destPos = byteOffsetToCaret(content, target); - _frame.currentEditor.setCaretPos(destPos.line,destPos.pos); + _frame.currentEditor.setCaretPos(destPos.line,destPos.pos, true, true); _frame.currentEditor.setFocus(); return true; default: diff --git a/src/dlangide/ui/dsourceedit.d b/src/dlangide/ui/dsourceedit.d index 4a0943a..aaace8c 100644 --- a/src/dlangide/ui/dsourceedit.d +++ b/src/dlangide/ui/dsourceedit.d @@ -224,6 +224,12 @@ class DSourceEdit : SourceEdit, EditableContentMarksChangeListener { return super.handleAction(a); } + /// Handle Ctrl + Left mouse click on text + override protected void onControlClick() { + window.dispatchAction(ACTION_GO_TO_DEFINITION); + } + + /// left button click on icons panel: toggle breakpoint override protected bool handleLeftPaneIconsMouseClick(MouseEvent event, Rect rc, int line) { if (event.button == MouseButton.Left) {