diff --git a/lib/ace/commands/default_commands.js b/lib/ace/commands/default_commands.js index 0ba9956c..fa4592a0 100644 --- a/lib/ace/commands/default_commands.js +++ b/lib/ace/commands/default_commands.js @@ -127,6 +127,26 @@ exports.commands = [{ bindKey: bindKey("Ctrl-Shift-K", "Command-Shift-G"), exec: function(editor) { editor.findPrevious(); }, readOnly: true +}, { + name: "selectOrFindNext", + bindKey: bindKey("ALt-K", "Ctrl-G"), + exec: function(editor) { + if (editor.selection.isEmpty()) + editor.selection.selectWord(); + else + editor.findNext(); + }, + readOnly: true +}, { + name: "selectOrFindPrevious", + bindKey: bindKey("Alt-Shift-K", "Ctrl-Shift-G"), + exec: function(editor) { + if (editor.selection.isEmpty()) + editor.selection.selectWord(); + else + editor.findPrevious(); + }, + readOnly: true }, { name: "find", bindKey: bindKey("Ctrl-F", "Command-F"), diff --git a/lib/ace/multi_select.js b/lib/ace/multi_select.js index 2152275e..7f4c5355 100644 --- a/lib/ace/multi_select.js +++ b/lib/ace/multi_select.js @@ -696,7 +696,8 @@ var Editor = require("./editor").Editor; range = session.getWordRange(range.start.row, range.start.column); range.cursor = dir == -1 ? range.start : range.end; this.multiSelect.addRange(range); - return; + // todo add option for sublime like behavior + // return; } var needle = session.getTextRange(range);