Skip to content

Commit

Permalink
Fix bug where search.js would dereference undefined
Browse files Browse the repository at this point in the history
Occurred when starting a (regular) replace below the last match.

Closes #582
  • Loading branch information
marijnh committed Jun 18, 2012
1 parent beadea5 commit ced414a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/util/search.js
Expand Up @@ -88,7 +88,7 @@
if (!(match = cursor.findNext())) {
cursor = cm.getSearchCursor(query);
if (!(match = cursor.findNext()) ||
(cursor.from().line == start.line && cursor.from().ch == start.ch)) return;
(start && cursor.from().line == start.line && cursor.from().ch == start.ch)) return;
}
cm.setSelection(cursor.from(), cursor.to());
confirmDialog(cm, doReplaceConfirm, "Replace?",
Expand Down

0 comments on commit ced414a

Please sign in to comment.