mirror of https://github.com/buggins/dlangide.git
fix goToDefinition cursor setting if file is newly opened - close #108
This commit is contained in:
parent
4bac204a25
commit
c05067002c
2
dub.json
2
dub.json
|
@ -12,7 +12,7 @@
|
||||||
"stringImportPaths": ["views", "views/res", "views/res/i18n", "views/res/mdpi", "views/res/hdpi"],
|
"stringImportPaths": ["views", "views/res", "views/res/i18n", "views/res/mdpi", "views/res/hdpi"],
|
||||||
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"dlangui": "~>0.7.49",
|
"dlangui": "~>0.7.50",
|
||||||
"dcd": "~>0.7.5"
|
"dcd": "~>0.7.5"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,10 @@ class DEditorTool : EditorTool
|
||||||
Log.d("Declaration is in current file. Jumping to it.");
|
Log.d("Declaration is in current file. Jumping to it.");
|
||||||
} else {
|
} else {
|
||||||
//Must open file first to get the content for finding the correct caret position.
|
//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);
|
content = toUTF8(_frame.currentEditor.text);
|
||||||
}
|
}
|
||||||
auto target = to!int(output.offset);
|
auto target = to!int(output.offset);
|
||||||
|
|
Loading…
Reference in New Issue