isearch: commands searchAsRegExp and selectAllMatches
This commit is contained in:
parent
7bb5b305be
commit
a93646d2f7
1 changed files with 22 additions and 0 deletions
|
|
@ -162,6 +162,28 @@ exports.iSearchCommands = [{
|
||||||
exec: function(iSearch) { iSearch.$editor.execCommand('recenterTopBottom'); },
|
exec: function(iSearch) { iSearch.$editor.execCommand('recenterTopBottom'); },
|
||||||
readOnly: true,
|
readOnly: true,
|
||||||
isIncrementalSearchCommand: true
|
isIncrementalSearchCommand: true
|
||||||
|
}, {
|
||||||
|
name: 'selectAllMatches',
|
||||||
|
bindKey: 'Ctrl-space',
|
||||||
|
exec: function(iSearch) {
|
||||||
|
var ed = iSearch.$editor,
|
||||||
|
hl = ed.session.$isearchHighlight,
|
||||||
|
ranges = hl && hl.cache ? hl.cache
|
||||||
|
.reduce(function(ranges, ea) {
|
||||||
|
return ranges.concat(ea ? ea : []); }, []) : [];
|
||||||
|
iSearch.deactivate(false);
|
||||||
|
ranges.forEach(ed.selection.addRange.bind(ed.selection));
|
||||||
|
},
|
||||||
|
readOnly: true,
|
||||||
|
isIncrementalSearchCommand: true
|
||||||
|
}, {
|
||||||
|
name: 'searchAsRegExp',
|
||||||
|
bindKey: 'Alt-r',
|
||||||
|
exec: function(iSearch) {
|
||||||
|
iSearch.convertNeedleToRegExp();
|
||||||
|
},
|
||||||
|
readOnly: true,
|
||||||
|
isIncrementalSearchCommand: true
|
||||||
}];
|
}];
|
||||||
|
|
||||||
function IncrementalSearchKeyboardHandler(iSearch) {
|
function IncrementalSearchKeyboardHandler(iSearch) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue