Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Unified Diff: Source/devtools/front_end/console/ConsoleView.js

Issue 632573002: Adding regex support to search bar in dev tools console (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/console/ConsoleView.js
diff --git a/Source/devtools/front_end/console/ConsoleView.js b/Source/devtools/front_end/console/ConsoleView.js
index 41ea4f0530eb384215ace4ffd8beb1a3349ce30f..c9bad84014f59db30f9697f46ce79cca338cfa55 100644
--- a/Source/devtools/front_end/console/ConsoleView.js
+++ b/Source/devtools/front_end/console/ConsoleView.js
@@ -39,7 +39,7 @@ WebInspector.ConsoleView = function()
WebInspector.VBox.call(this);
this.registerRequiredCSS("filter.css");
- this._searchableView = new WebInspector.SearchableView(this);
+ this._searchableView = new WebInspector.SearchableView(this, true);
robwu 2014/10/06 08:30:21 Why did you use true as the default setting? Plain
this._searchableView.setMinimalSearchQuerySize(0);
this._searchableView.show(this.element);
@@ -913,7 +913,12 @@ WebInspector.ConsoleView.prototype = {
{
this.searchCanceled();
this._searchableView.updateSearchMatchesCount(0);
- this._searchRegex = createPlainTextSearchRegex(query, "gi");
+ if (!this._searchableView.enableRegex) {
+ this._searchRegex = createPlainTextSearchRegex(query, "gi");
+ }
+ else {
robwu 2014/10/06 08:30:21 } else { must be on a single line.
aknudsen 2014/10/07 19:39:57 Done.
+ this._searchRegex = new RegExp(query, "gi");
robwu 2014/10/06 08:30:22 Use a separate function or method to construct the
aknudsen 2014/10/07 19:39:57 Acknowledged.
aknudsen 2014/10/07 20:50:12 Done.
+ }
/** @type {!Array.<number>} */
this._searchResults = [];

Powered by Google App Engine
This is Rietveld 408576698