From 8bf516263c6582771e7576e8484ca8cfaa8cb9cb Mon Sep 17 00:00:00 2001 From: Cheng-Han, Wu Date: Wed, 20 Apr 2016 18:11:40 +0800 Subject: Update CodeMirror to 5.13.5 --- public/vendor/codemirror/addon/search/match-highlighter.js | 2 +- public/vendor/codemirror/addon/search/search.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'public/vendor/codemirror/addon/search') diff --git a/public/vendor/codemirror/addon/search/match-highlighter.js b/public/vendor/codemirror/addon/search/match-highlighter.js index 8f02f01c..79218c31 100644 --- a/public/vendor/codemirror/addon/search/match-highlighter.js +++ b/public/vendor/codemirror/addon/search/match-highlighter.js @@ -16,7 +16,7 @@ // highlighted only if the selected text is a word. showToken, when enabled, // will cause the current token to be highlighted when nothing is selected. // delay is used to specify how much time to wait, in milliseconds, before -// highlighting the matches. If annotateScrollbar is enabled, the occurances +// highlighting the matches. If annotateScrollbar is enabled, the occurences // will be highlighted on the scrollbar via the matchesonscrollbar addon. (function(mod) { 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())) { -- cgit v1.2.3