From 403108bf3959a296050f515788864b95a9a200e1 Mon Sep 17 00:00:00 2001 From: Vadim Lopatin Date: Tue, 26 Sep 2017 11:26:44 +0300 Subject: [PATCH] update action shortcut override - fix #208 --- dub.json | 2 +- src/dlangide/ui/commands.d | 25 +++++++++++++++++++++++++ src/dlangide/ui/frame.d | 17 +---------------- views/VERSION | 2 +- 4 files changed, 28 insertions(+), 18 deletions(-) diff --git a/dub.json b/dub.json index a4fd08b..65add91 100644 --- a/dub.json +++ b/dub.json @@ -12,7 +12,7 @@ "stringImportPaths": ["views"], "dependencies": { - "dlangui": "==0.9.146", + "dlangui": "==0.9.147", "dsymbol": "~>0.2.9", "dcd": "~>0.9.1" }, diff --git a/src/dlangide/ui/commands.d b/src/dlangide/ui/commands.d index 30e23f2..b76eddc 100644 --- a/src/dlangide/ui/commands.d +++ b/src/dlangide/ui/commands.d @@ -175,3 +175,28 @@ const Action ACTION_GET_PAREN_COMPLETION = (new Action(IDEActions.GetParenComple const Action ACTION_GO_TO_LINE = (new Action(IDEActions.GotoLine, "GO_TO_LINE"c, ""c, KeyCode.KEY_L, KeyFlag.Control|KeyFlag.Option)).disableByDefault();; const Action ACTION_FIND_TEXT = (new Action(IDEActions.FindInFiles, "FIND_IN_FILES"c, "edit-find"c, KeyCode.KEY_F, KeyFlag.Control | KeyFlag.Shift)).disableByDefault(); + +const Action[] STD_IDE_ACTIONS = [ + ACTION_EDIT_COPY, ACTION_EDIT_PASTE, ACTION_EDIT_CUT, + ACTION_EDIT_UNDO, ACTION_EDIT_REDO, + ACTION_EDIT_INDENT, ACTION_EDIT_UNINDENT, + ACTION_EDIT_TOGGLE_LINE_COMMENT, ACTION_EDIT_TOGGLE_BLOCK_COMMENT, + ACTION_EDIT_PREFERENCES, + ACTION_FILE_NEW_SOURCE_FILE, ACTION_FILE_NEW_WORKSPACE, ACTION_FILE_NEW_PROJECT, ACTION_FILE_OPEN_WORKSPACE, ACTION_FILE_OPEN, + ACTION_FILE_SAVE, ACTION_FILE_SAVE_AS, ACTION_FILE_SAVE_ALL, ACTION_FILE_EXIT, + ACTION_PROJECT_SET_STARTUP, ACTION_PROJECT_REFRESH, ACTION_PROJECT_UPDATE_DEPENDENCIES, + ACTION_PROJECT_SETTINGS, ACTION_WORKSPACE_BUILD, ACTION_WORKSPACE_REBUILD, ACTION_WORKSPACE_CLEAN, + ACTION_PROJECT_BUILD, ACTION_PROJECT_REBUILD, ACTION_PROJECT_CLEAN, ACTION_RUN_WITH_RDMD, + ACTION_DEBUG_START, ACTION_DEBUG_START_NO_DEBUG, ACTION_DEBUG_CONTINUE, ACTION_DEBUG_STOP, ACTION_DEBUG_PAUSE, + ACTION_DEBUG_RESTART, + ACTION_DEBUG_STEP_INTO, + ACTION_DEBUG_STEP_OVER, + ACTION_DEBUG_STEP_OUT, + ACTION_WINDOW_CLOSE_DOCUMENT, ACTION_WINDOW_CLOSE_ALL_DOCUMENTS, ACTION_HELP_ABOUT, + ACTION_GET_DOC_COMMENTS, + ACTION_GO_TO_DEFINITION, + ACTION_GET_COMPLETIONS, + ACTION_GET_PAREN_COMPLETION, + ACTION_GO_TO_LINE, + ACTION_FIND_TEXT, +]; diff --git a/src/dlangide/ui/frame.d b/src/dlangide/ui/frame.d index 46772c3..f22ea9d 100644 --- a/src/dlangide/ui/frame.d +++ b/src/dlangide/ui/frame.d @@ -806,22 +806,7 @@ class IDEFrame : AppFrame, ProgramExecutionStatusListener, BreakpointListChangeL } else { Log.d("Saving default shortcuts"); const(Action)[] actions; - actions ~= [ - ACTION_EDIT_COPY, ACTION_EDIT_PASTE, ACTION_EDIT_CUT, - ACTION_EDIT_UNDO, ACTION_EDIT_REDO, ACTION_EDIT_INDENT, - ACTION_EDIT_UNINDENT, ACTION_EDIT_TOGGLE_LINE_COMMENT, ACTION_EDIT_TOGGLE_BLOCK_COMMENT, - ACTION_EDIT_PREFERENCES, - ACTION_FILE_NEW_SOURCE_FILE, ACTION_FILE_NEW_WORKSPACE, ACTION_FILE_NEW_PROJECT, ACTION_FILE_OPEN_WORKSPACE, ACTION_FILE_OPEN, - ACTION_FILE_SAVE, ACTION_FILE_SAVE_AS, ACTION_FILE_SAVE_ALL, ACTION_FILE_EXIT, - ACTION_PROJECT_SET_STARTUP, ACTION_PROJECT_REFRESH, ACTION_PROJECT_UPDATE_DEPENDENCIES, - ACTION_PROJECT_SETTINGS, ACTION_WORKSPACE_BUILD, ACTION_WORKSPACE_REBUILD, ACTION_WORKSPACE_CLEAN, - ACTION_PROJECT_BUILD, ACTION_PROJECT_REBUILD, ACTION_PROJECT_CLEAN, ACTION_RUN_WITH_RDMD, - ACTION_DEBUG_START, ACTION_DEBUG_START_NO_DEBUG, ACTION_DEBUG_CONTINUE, ACTION_DEBUG_STOP, ACTION_DEBUG_PAUSE, - ACTION_DEBUG_RESTART, - ACTION_DEBUG_STEP_INTO, - ACTION_DEBUG_STEP_OVER, - ACTION_DEBUG_STEP_OUT, - ACTION_WINDOW_CLOSE_DOCUMENT, ACTION_WINDOW_CLOSE_ALL_DOCUMENTS, ACTION_HELP_ABOUT]; + actions ~= STD_IDE_ACTIONS; actions ~= STD_EDITOR_ACTIONS; saveShortcutsSettings(actions); } diff --git a/views/VERSION b/views/VERSION index ae9ccfc..a428edf 100644 --- a/views/VERSION +++ b/views/VERSION @@ -1 +1 @@ -v0.7.95 \ No newline at end of file +v0.7.96 \ No newline at end of file