summaryrefslogtreecommitdiff
path: root/public/vendor/codemirror/addon/search/search.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/vendor/codemirror/addon/search/search.js')
-rw-r--r--public/vendor/codemirror/addon/search/search.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/public/vendor/codemirror/addon/search/search.js b/public/vendor/codemirror/addon/search/search.js
index 93e90b36..e6b4f85a 100644
--- a/public/vendor/codemirror/addon/search/search.js
+++ b/public/vendor/codemirror/addon/search/search.js
@@ -121,7 +121,10 @@
persistentDialog(cm, queryDialog, q, function(query, event) {
CodeMirror.e_stop(event);
if (!query) return;
- if (query != state.queryText) startSearch(cm, state, query);
+ if (query != state.queryText) {
+ startSearch(cm, state, query);
+ state.posFrom = state.posTo = cm.getCursor();
+ }
if (hiding) hiding.style.opacity = 1
findNext(cm, event.shiftKey, function(_, to) {
var dialog
@@ -193,7 +196,7 @@
replaceAll(cm, query, text)
} else {
clearSearch(cm);
- var cursor = getSearchCursor(cm, query, cm.getCursor());
+ var cursor = getSearchCursor(cm, query, cm.getCursor("from"));
var advance = function() {
var start = cursor.from(), match;
if (!(match = cursor.findNext())) {