make cut a command, and add documentation

This commit is contained in:
nightwing 2012-04-12 22:42:10 +04:00
commit 2b3a950613
3 changed files with 92 additions and 38 deletions

View file

@ -293,6 +293,18 @@ exports.commands = [{
// commands disabled in readOnly mode
{
name: "cut",
exec: function(editor) {
var range = editor.getSelectionRange();
editor._emit("cut", range);
if (!editor.selection.isEmpty()) {
editor.session.remove(range);
editor.clearSelection();
}
},
multiSelectAction: "forEach"
}, {
name: "removeline",
bindKey: bindKey("Ctrl-D", "Command-D"),
exec: function(editor) { editor.removeLines(); },