Title: [164846] trunk/Source/WebInspectorUI
Revision
164846
Author
[email protected]
Date
2014-02-27 17:18:55 -0800 (Thu, 27 Feb 2014)

Log Message

Use a RegExp when when using CodeMirror's SearchCursor.

This avoids doing toLowerCase() on every line of the TextEditor.

https://bugs.webkit.org/show_bug.cgi?id=129463

Reviewed by Joseph Pecoraro.

* UserInterface/Views/TextEditor.js:
(TextEditor.prototype.performSearch): Use a RegExp for query. Pass false for the caseFold
argument, but it is ignored for RegExp searches anyway.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (164845 => 164846)


--- trunk/Source/WebInspectorUI/ChangeLog	2014-02-28 01:17:37 UTC (rev 164845)
+++ trunk/Source/WebInspectorUI/ChangeLog	2014-02-28 01:18:55 UTC (rev 164846)
@@ -1,3 +1,17 @@
+2014-02-27  Timothy Hatcher  <[email protected]>
+
+        Use a RegExp when when using CodeMirror's SearchCursor.
+
+        This avoids doing toLowerCase() on every line of the TextEditor.
+
+        https://bugs.webkit.org/show_bug.cgi?id=129463
+
+        Reviewed by Joseph Pecoraro.
+
+        * UserInterface/Views/TextEditor.js:
+        (TextEditor.prototype.performSearch): Use a RegExp for query. Pass false for the caseFold
+        argument, but it is ignored for RegExp searches anyway.
+
 2014-02-27  Brian Burg  <[email protected]>
 
         Web Inspector: model tests should use a special Test.html inspector page

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TextEditor.js (164845 => 164846)


--- trunk/Source/WebInspectorUI/UserInterface/Views/TextEditor.js	2014-02-28 01:17:37 UTC (rev 164845)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TextEditor.js	2014-02-28 01:18:55 UTC (rev 164846)
@@ -311,7 +311,8 @@
         }
 
         // Go down the slow patch for all other text content.
-        var searchCursor = this._codeMirror.getSearchCursor(query, {line: 0, ch: 0}, true);
+        var queryRegex = new RegExp(query.escapeForRegExp(), "gi");
+        var searchCursor = this._codeMirror.getSearchCursor(queryRegex, {line: 0, ch: 0}, false);
         var boundBatchSearch = batchSearch.bind(this);
         var numberOfSearchResultsDidChangeTimeout = null;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to