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