BlockIndent command ( Ctrl-[ and Ctrl-] )
This commit is contained in:
parent
4d43496201
commit
3952ef9afd
2 changed files with 22 additions and 3 deletions
|
|
@ -414,6 +414,16 @@ exports.commands = [{
|
|||
bindKey: bindKey("Tab", "Tab"),
|
||||
exec: function(editor) { editor.indent(); },
|
||||
multiSelectAction: "forEach"
|
||||
},{
|
||||
name: "blockoutdent",
|
||||
bindKey: bindKey("Ctrl-[", "Ctrl-["),
|
||||
exec: function(editor) { editor.blockOutdent(); },
|
||||
multiSelectAction: "forEach"
|
||||
},{
|
||||
name: "blockindent",
|
||||
bindKey: bindKey("Ctrl-]", "Ctrl-]"),
|
||||
exec: function(editor) { editor.blockIndent(); },
|
||||
multiSelectAction: "forEach"
|
||||
}, {
|
||||
name: "insertstring",
|
||||
exec: function(editor, str) { editor.insert(str); },
|
||||
|
|
|
|||
|
|
@ -1245,8 +1245,8 @@ var Editor = function(renderer, session) {
|
|||
this.selection.setSelectionRange(originalRange);
|
||||
};
|
||||
|
||||
/**
|
||||
* Indents the current line.
|
||||
/**
|
||||
* Inserts an indentation into the current cursor position or indents the selected lines.
|
||||
*
|
||||
* @related EditSession.indentRows
|
||||
**/
|
||||
|
|
@ -1273,7 +1273,16 @@ var Editor = function(renderer, session) {
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
/**
|
||||
* Indents the current line.
|
||||
* @related EditSession.indentRows
|
||||
**/
|
||||
this.blockIndent = function() {
|
||||
var rows = this.$getSelectedRows();
|
||||
this.session.indentRows(rows.first, rows.last, "\t");
|
||||
};
|
||||
|
||||
/**
|
||||
* Outdents the current line.
|
||||
* @related EditSession.outdentRows
|
||||
**/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue