Skip to content

Commit

Permalink
Editor: Ctrl/Cmd-D is now dupLine, Ctrl/Cmd-Shift-D is removeLine
Browse files Browse the repository at this point in the history
  • Loading branch information
adriweb committed Oct 23, 2016
1 parent af64e0a commit 52f1697
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion modules/native_eZ80/js/cm_custom.js
Expand Up @@ -22,6 +22,20 @@ function do_cm_custom()

$('[data-toggle="tooltip"]').tooltip();

editor.removeKeyMap("Ctrl-D");

var dupLine = function (cm)
{
var doc = cm.getDoc();
var cursor = doc.getCursor();
var line = doc.getLine(cursor.line);
var pos = {
line: cursor.line,
ch: line.length
};
doc.replaceRange('\n' + line, pos);
};

editor.addKeyMap({
"Tab": function (cm)
{
Expand All @@ -40,7 +54,9 @@ function do_cm_custom()
"Shift-Tab": function (cm)
{
cm.indentSelection("subtract");
}
},
"Ctrl-D": dupLine, "Cmd-D": dupLine,
"Shift-Ctrl-D": function(cm) { cm.execCommand("deleteLine") }, "Shift-Cmd-D": function(cm) { cm.execCommand("deleteLine") }
});

dispSrc = function(callback)
Expand Down

0 comments on commit 52f1697

Please sign in to comment.