From f977636742eff684ffdf68379f8388d1d03adbc9 Mon Sep 17 00:00:00 2001 From: Vadim Lopatin Date: Wed, 13 Sep 2017 18:19:13 +0300 Subject: [PATCH] fix slow closing of window under win32; additional fix to focus editor for #292 --- dub.json | 2 +- src/dlangide/ui/frame.d | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/dub.json b/dub.json index aac32c5..b8d80f3 100644 --- a/dub.json +++ b/dub.json @@ -12,7 +12,7 @@ "stringImportPaths": ["views"], "dependencies": { - "dlangui": "==0.9.131", + "dlangui": "==0.9.132", "dsymbol": "~>0.2.9", "dcd": "~>0.9.1" }, diff --git a/src/dlangide/ui/frame.d b/src/dlangide/ui/frame.d index da20d1a..c10cb47 100644 --- a/src/dlangide/ui/frame.d +++ b/src/dlangide/ui/frame.d @@ -898,6 +898,7 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL case IDEActions.WindowCloseAllDocuments: case IDEActions.FileSaveAll: case IDEActions.FileSaveAs: + case IDEActions.GotoLine: a.state = (currentEditor !is null && !_currentBackgroundOperation) ? ACTION_STATE_ENABLED : ACTION_STATE_DISABLE; return true; default: @@ -1092,13 +1093,16 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL auto num = to!uint(s); // Check line existence if (num < 1 || num > currentEditor.content.length) { + currentEditor.setFocus(); window.showMessageBox(UIString.fromId("ERROR"c), UIString.fromId("ERROR_NO_SUCH_LINE"c)); return; } // Go to line currentEditor.setCaretPos(num - 1, 0); + currentEditor.setFocus(); } catch (ConvException e) { + currentEditor.setFocus(); window.showMessageBox(UIString.fromId("ERROR"c), UIString.fromId("ERROR_INVALID_NUMBER"c)); } });