From c05067002cddfdee6abb8b088bec8586e6f52468 Mon Sep 17 00:00:00 2001 From: Vadim Lopatin Date: Tue, 26 Jan 2016 09:41:46 +0300 Subject: [PATCH] fix goToDefinition cursor setting if file is newly opened - close #108 --- dub.json | 2 +- src/dlangide/tools/d/deditortool.d | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dub.json b/dub.json index a41dff8..5afd5f7 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.49", + "dlangui": "~>0.7.50", "dcd": "~>0.7.5" }, diff --git a/src/dlangide/tools/d/deditortool.d b/src/dlangide/tools/d/deditortool.d index b9ae789..e160cff 100644 --- a/src/dlangide/tools/d/deditortool.d +++ b/src/dlangide/tools/d/deditortool.d @@ -45,7 +45,10 @@ class DEditorTool : EditorTool Log.d("Declaration is in current file. Jumping to it."); } else { //Must open file first to get the content for finding the correct caret position. - _frame.openSourceFile(to!string(fileName)); + if (!_frame.openSourceFile(to!string(fileName))) + return false; + if (_frame.currentEditor.parent) + _frame.currentEditor.parent.layout(_frame.currentEditor.parent.pos); content = toUTF8(_frame.currentEditor.text); } auto target = to!int(output.offset);