From 5cfd4e0d1f566785ef80f55d77a4d305352487c4 Mon Sep 17 00:00:00 2001 From: James Allen Date: Thu, 4 Feb 2016 15:42:54 +0000 Subject: [PATCH] Fix toggle comment hotkey for European keyboards --- .../coffee/ide/editor/directives/aceEditor.coffee | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/services/web/public/coffee/ide/editor/directives/aceEditor.coffee b/services/web/public/coffee/ide/editor/directives/aceEditor.coffee index 3b9b81fae4..d193c47d6f 100644 --- a/services/web/public/coffee/ide/editor/directives/aceEditor.coffee +++ b/services/web/public/coffee/ide/editor/directives/aceEditor.coffee @@ -69,6 +69,21 @@ define [ editor.commands.removeCommand "transposeletters" editor.commands.removeCommand "showSettingsMenu" editor.commands.removeCommand "foldall" + + # For European keyboards, the / is above 7 so needs Shift pressing. + # This comes through as Ctrl-Shift-/ which is mapped to toggleBlockComment. + # This doesn't do anything for LaTeX, so remap this to togglecomment to + # work for European keyboards as normal. + editor.commands.removeCommand "toggleBlockComment" + editor.commands.removeCommand "togglecomment" + + editor.commands.addCommand { + name: "togglecomment", + bindKey: { win: "Ctrl-/|Ctrl-Shift-/", mac: "Command-/|Command-Shift-/" }, + exec: (editor) -> editor.toggleCommentLines(), + multiSelectAction: "forEachLine", + scrollIntoView: "selectionPart" + } # Trigger search AND replace on CMD+F editor.commands.addCommand