emacs/isearch: select when moving cursor via isearch and emacs mark is set
This commit is contained in:
parent
b966cfd7da
commit
78b2147c3c
1 changed files with 3 additions and 2 deletions
|
|
@ -140,10 +140,11 @@ oop.inherits(IncrementalSearch, Search);
|
|||
// try to find the next occurence and enable highlighting marker
|
||||
options.start = this.$currentPos;
|
||||
var session = this.$editor.session,
|
||||
found = this.find(session);
|
||||
found = this.find(session),
|
||||
shouldSelect = !!this.$editor.emacsMark();
|
||||
if (found) {
|
||||
if (options.backwards) found = Range.fromPoints(found.end, found.start);
|
||||
this.$editor.moveCursorToPosition(found.end);
|
||||
this.$editor.selection.setRange(Range.fromPoints(shouldSelect ? this.$startPos : found.end, found.end));
|
||||
if (moveToNext) this.$currentPos = found.end;
|
||||
// highlight after cursor move, so selection works properly
|
||||
this.highlight(options.re)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue