fix slow closing of window under win32; additional fix to focus editor for #292

This commit is contained in:
Vadim Lopatin 2017-09-13 18:19:13 +03:00
parent bf0e340e16
commit f977636742
2 changed files with 5 additions and 1 deletions

View file

@ -12,7 +12,7 @@
"stringImportPaths": ["views"], "stringImportPaths": ["views"],
"dependencies": { "dependencies": {
"dlangui": "==0.9.131", "dlangui": "==0.9.132",
"dsymbol": "~>0.2.9", "dsymbol": "~>0.2.9",
"dcd": "~>0.9.1" "dcd": "~>0.9.1"
}, },

View file

@ -898,6 +898,7 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
case IDEActions.WindowCloseAllDocuments: case IDEActions.WindowCloseAllDocuments:
case IDEActions.FileSaveAll: case IDEActions.FileSaveAll:
case IDEActions.FileSaveAs: case IDEActions.FileSaveAs:
case IDEActions.GotoLine:
a.state = (currentEditor !is null && !_currentBackgroundOperation) ? ACTION_STATE_ENABLED : ACTION_STATE_DISABLE; a.state = (currentEditor !is null && !_currentBackgroundOperation) ? ACTION_STATE_ENABLED : ACTION_STATE_DISABLE;
return true; return true;
default: default:
@ -1092,13 +1093,16 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL
auto num = to!uint(s); auto num = to!uint(s);
// Check line existence // Check line existence
if (num < 1 || num > currentEditor.content.length) { if (num < 1 || num > currentEditor.content.length) {
currentEditor.setFocus();
window.showMessageBox(UIString.fromId("ERROR"c), UIString.fromId("ERROR_NO_SUCH_LINE"c)); window.showMessageBox(UIString.fromId("ERROR"c), UIString.fromId("ERROR_NO_SUCH_LINE"c));
return; return;
} }
// Go to line // Go to line
currentEditor.setCaretPos(num - 1, 0); currentEditor.setCaretPos(num - 1, 0);
currentEditor.setFocus();
} }
catch (ConvException e) { catch (ConvException e) {
currentEditor.setFocus();
window.showMessageBox(UIString.fromId("ERROR"c), UIString.fromId("ERROR_INVALID_NUMBER"c)); window.showMessageBox(UIString.fromId("ERROR"c), UIString.fromId("ERROR_INVALID_NUMBER"c));
} }
}); });