From 0a055cb7259dcc697a0a2a4820293201895c9314 Mon Sep 17 00:00:00 2001 From: Robert Krahn Date: Tue, 4 Nov 2014 21:10:14 -0800 Subject: [PATCH] isearch: being flexible about whether emacs mode is on or not --- lib/ace/incremental_search.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ace/incremental_search.js b/lib/ace/incremental_search.js index ee74f60d..0f32e0c1 100644 --- a/lib/ace/incremental_search.js +++ b/lib/ace/incremental_search.js @@ -141,7 +141,8 @@ oop.inherits(IncrementalSearch, Search); options.start = this.$currentPos; var session = this.$editor.session, found = this.find(session), - shouldSelect = !!this.$editor.emacsMark(); + shouldSelect = this.$editor.emacsMark ? + !!this.$editor.emacsMark() : !this.$editor.selection.isEmpty(); if (found) { if (options.backwards) found = Range.fromPoints(found.end, found.start); this.$editor.selection.setRange(Range.fromPoints(shouldSelect ? this.$startPos : found.end, found.end));