add selectOrFindNext commands and disable sublime ctrl-d like behavior of ctrl-arrow

This commit is contained in:
nightwing 2013-11-24 16:09:52 +04:00
commit d03e5d1120
2 changed files with 22 additions and 1 deletions

View file

@ -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"),

View file

@ -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);