Commit 45c485e1 authored by vsevik@chromium.org's avatar vsevik@chromium.org

DevTools: Update search counters on editing

BUG=410298
R=lushnikov

Review URL: https://codereview.chromium.org/536323003

git-svn-id: svn://svn.chromium.org/blink/trunk@181452 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent a08a36e2
...@@ -323,7 +323,7 @@ WebInspector.SourceFrame.prototype = { ...@@ -323,7 +323,7 @@ WebInspector.SourceFrame.prototype = {
onTextChanged: function(oldRange, newRange) onTextChanged: function(oldRange, newRange)
{ {
if (this._searchResultsChangedCallback && !this._isReplacing) if (this._searchResultsChangedCallback)
this._searchResultsChangedCallback(); this._searchResultsChangedCallback();
this.clearMessages(); this.clearMessages();
}, },
...@@ -564,11 +564,7 @@ WebInspector.SourceFrame.prototype = { ...@@ -564,11 +564,7 @@ WebInspector.SourceFrame.prototype = {
if (!range) if (!range)
return; return;
this._textEditor.highlightSearchResults(this._searchRegex, null); this._textEditor.highlightSearchResults(this._searchRegex, null);
this._isReplacing = true;
var newRange = this._textEditor.editRange(range, text); var newRange = this._textEditor.editRange(range, text);
delete this._isReplacing;
this._textEditor.setSelection(newRange.collapseToEnd()); this._textEditor.setSelection(newRange.collapseToEnd());
}, },
...@@ -603,11 +599,9 @@ WebInspector.SourceFrame.prototype = { ...@@ -603,11 +599,9 @@ WebInspector.SourceFrame.prototype = {
if (replacementLineEndings.length > 1) if (replacementLineEndings.length > 1)
lastColumnNumber = replacementLineEndings[replacementLineCount - 1] - replacementLineEndings[replacementLineCount - 2] - 1; lastColumnNumber = replacementLineEndings[replacementLineCount - 1] - replacementLineEndings[replacementLineCount - 2] - 1;
this._isReplacing = true;
this._textEditor.editRange(range, text); this._textEditor.editRange(range, text);
this._textEditor.revealPosition(lastLineNumber, lastColumnNumber); this._textEditor.revealPosition(lastLineNumber, lastColumnNumber);
this._textEditor.setSelection(WebInspector.TextRange.createFromLocation(lastLineNumber, lastColumnNumber)); this._textEditor.setSelection(WebInspector.TextRange.createFromLocation(lastLineNumber, lastColumnNumber));
delete this._isReplacing;
}, },
_collectRegexMatches: function(regexObject) _collectRegexMatches: function(regexObject)
......
...@@ -532,7 +532,7 @@ WebInspector.SourcesView.prototype = { ...@@ -532,7 +532,7 @@ WebInspector.SourcesView.prototype = {
*/ */
function searchResultsChanged() function searchResultsChanged()
{ {
this._searchableView.cancelSearch(); this.performSearch(query, false, false);
} }
this._searchView.performSearch(query, shouldJump, !!jumpBackwards, finishedCallback.bind(this), currentMatchChanged.bind(this), searchResultsChanged.bind(this)); this._searchView.performSearch(query, shouldJump, !!jumpBackwards, finishedCallback.bind(this), currentMatchChanged.bind(this), searchResultsChanged.bind(this));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment