From 43c74f415fe875f4675889bbadda2d93444bdb7c Mon Sep 17 00:00:00 2001 From: Garen Torikian Date: Tue, 23 Oct 2012 11:00:13 -0700 Subject: [PATCH] Add tenth place, fix doc comments --- lib/ace/commands/default_commands.js | 10 ++++++++++ lib/ace/editor.js | 10 +++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/lib/ace/commands/default_commands.js b/lib/ace/commands/default_commands.js index ec85f61c..f7c96538 100644 --- a/lib/ace/commands/default_commands.js +++ b/lib/ace/commands/default_commands.js @@ -341,6 +341,16 @@ exports.commands = [{ bindKey: bindKey("Ctrl-Shift-Down", "Alt-Shift-Down"), exec: function(editor) { editor.modifyNumber(-1); }, multiSelectAction: "forEach" +}, { + name: "modifyNumber+10", + bindKey: bindKey("Ctrl-Alt-Shift-Up", "Alt-Command-Shift-Up"), + exec: function(editor) { editor.modifyNumber(10); }, + multiSelectAction: "forEach" +}, { + name: "modifyNumber-10", + bindKey: bindKey("Ctrl-Alt-Shift-Down", "Alt-Command-Shift-Down"), + exec: function(editor) { editor.modifyNumber(-10); }, + multiSelectAction: "forEach" }, { name: "replace", bindKey: bindKey("Ctrl-R", "Command-Option-F"), diff --git a/lib/ace/editor.js b/lib/ace/editor.js index 318844a3..85fb5a18 100644 --- a/lib/ace/editor.js +++ b/lib/ace/editor.js @@ -1304,7 +1304,7 @@ var Editor = function(renderer, session) { /** * Editor.toggleCommentLines() * - * Given the currently selected range, this function either comments all lines or uncomments all lines (depending on whether it's commented or not). + * Given the currently selected range, this function either comments all the lines, or uncomments all of them. **/ this.toggleCommentLines = function() { var state = this.session.getState(this.getCursorPosition().row); @@ -1313,9 +1313,9 @@ var Editor = function(renderer, session) { }; /** - * Editor.getNumberAt() + * Editor.getNumberAt() -> Number * - * Works like getTokenAt just that it returns a number + * Works like [[Editor.getTokenAt]], excepts it returns a number. **/ this.getNumberAt = function( row, column ) { var _numberRx = /[\-]?[0-9]+(?:\.[0-9]+)?/g @@ -1339,8 +1339,8 @@ var Editor = function(renderer, session) { /** * Editor.modifyNumber() * - * If the character before the cursor is a number, you can increase/descrease it's value with 1 by pressing Alt+Shift+Up/Down. - * This will update the whole number the digit is part of. + * If the character before the cursor is a number, you can increase/or decrease its value by one (by pressing Ctrl+Shift+Up/Down), or + * 10 (by pressing Ctrl+Alt+Shift+Up/Down). **/ this.modifyNumber = function(amount) { var row = this.selection.getCursor().row;