add selectOrFindNext commands and disable sublime ctrl-d like behavior of ctrl-arrow
This commit is contained in:
parent
a7798c4497
commit
d03e5d1120
2 changed files with 22 additions and 1 deletions
|
|
@ -127,6 +127,26 @@ exports.commands = [{
|
||||||
bindKey: bindKey("Ctrl-Shift-K", "Command-Shift-G"),
|
bindKey: bindKey("Ctrl-Shift-K", "Command-Shift-G"),
|
||||||
exec: function(editor) { editor.findPrevious(); },
|
exec: function(editor) { editor.findPrevious(); },
|
||||||
readOnly: true
|
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",
|
name: "find",
|
||||||
bindKey: bindKey("Ctrl-F", "Command-F"),
|
bindKey: bindKey("Ctrl-F", "Command-F"),
|
||||||
|
|
|
||||||
|
|
@ -696,7 +696,8 @@ var Editor = require("./editor").Editor;
|
||||||
range = session.getWordRange(range.start.row, range.start.column);
|
range = session.getWordRange(range.start.row, range.start.column);
|
||||||
range.cursor = dir == -1 ? range.start : range.end;
|
range.cursor = dir == -1 ? range.start : range.end;
|
||||||
this.multiSelect.addRange(range);
|
this.multiSelect.addRange(range);
|
||||||
return;
|
// todo add option for sublime like behavior
|
||||||
|
// return;
|
||||||
}
|
}
|
||||||
var needle = session.getTextRange(range);
|
var needle = session.getTextRange(range);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue