diff --git a/src/dlangide.d b/src/dlangide.d index 6801db1..cf3cfed 100644 --- a/src/dlangide.d +++ b/src/dlangide.d @@ -58,11 +58,11 @@ extern (C) int UIAppMain(string[] args) { // create window Window window = Platform.instance.createWindow("Dlang IDE", null, WindowFlag.Resizable, 700, 470); + // set window icon + window.windowIcon = drawableCache.getImage("dlangui-logo1"); IDEFrame frame = new IDEFrame(window); - // create some widget to show in window - window.windowIcon = drawableCache.getImage("dlangui-logo1"); // open home screen tab frame.showHomeScreen(); diff --git a/src/dlangide/ui/dsourceedit.d b/src/dlangide/ui/dsourceedit.d index a0f0bb3..b2291a4 100644 --- a/src/dlangide/ui/dsourceedit.d +++ b/src/dlangide/ui/dsourceedit.d @@ -120,7 +120,7 @@ class DSourceEdit : SourceEdit { void insertCompletion(dstring completionText) { TextRange range; - TextPosition p = getCaretPosition; + TextPosition p = caretPos; range.start = range.end = p; dstring lineText = content.line(p.line); dchar prevChar = p.pos > 0 ? lineText[p.pos - 1] : 0; @@ -204,15 +204,4 @@ class DSourceEdit : SourceEdit { Log.d("Showing popup at ", textPosToClient(_caretPos).left, " ", textPosToClient(_caretPos).top); } - TextPosition getCaretPosition() { - return _caretPos; - } - - /// change caret position and ensure it is visible - void setCaretPos(int line, int column) - { - _caretPos = TextPosition(line,column); - invalidate(); - ensureCaretVisible(); - } } diff --git a/src/dlangide/ui/frame.d b/src/dlangide/ui/frame.d index 61d405e..909785f 100644 --- a/src/dlangide/ui/frame.d +++ b/src/dlangide/ui/frame.d @@ -617,11 +617,11 @@ class IDEFrame : AppFrame { return true; case IDEActions.GoToDefinition: Log.d("Trying to go to definition."); - currentEditor.editorTool.goToDefinition(currentEditor(), currentEditor.getCaretPosition()); + currentEditor.editorTool.goToDefinition(currentEditor(), currentEditor.caretPos); return true; case IDEActions.GetCompletionSuggestions: Log.d("Getting auto completion suggestions."); - auto results = currentEditor.editorTool.getCompletions(currentEditor, currentEditor.getCaretPosition); + auto results = currentEditor.editorTool.getCompletions(currentEditor, currentEditor.caretPos); currentEditor.showCompletionPopup(results); return true; case IDEActions.EditPreferences: