Title: [233824] trunk/Source/WebInspectorUI
Revision
233824
Author
[email protected]
Date
2018-07-13 16:11:08 -0700 (Fri, 13 Jul 2018)

Log Message

Web Inspector: REGRESSION (r195723): Improve support for resources with '\r' and '\r\n' line endings
https://bugs.webkit.org/show_bug.cgi?id=186453
<rdar://problem/39689180>

Reviewed by Joseph Pecoraro.

Now that the frontend no longer uses offsets from the original source
file to calculate positions within CodeMirror, it is possible to support
resources with '\r' and '\r\n' line endings in the editor.

* UserInterface/Views/CodeMirrorEditor.js:
(WI.CodeMirrorEditor.create):
(WI.CodeMirrorEditor):

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (233823 => 233824)


--- trunk/Source/WebInspectorUI/ChangeLog	2018-07-13 22:54:16 UTC (rev 233823)
+++ trunk/Source/WebInspectorUI/ChangeLog	2018-07-13 23:11:08 UTC (rev 233824)
@@ -1,5 +1,21 @@
 2018-07-13  Matt Baker  <[email protected]>
 
+        Web Inspector: REGRESSION (r195723): Improve support for resources with '\r' and '\r\n' line endings
+        https://bugs.webkit.org/show_bug.cgi?id=186453
+        <rdar://problem/39689180>
+
+        Reviewed by Joseph Pecoraro.
+
+        Now that the frontend no longer uses offsets from the original source
+        file to calculate positions within CodeMirror, it is possible to support
+        resources with '\r' and '\r\n' line endings in the editor.
+
+        * UserInterface/Views/CodeMirrorEditor.js:
+        (WI.CodeMirrorEditor.create):
+        (WI.CodeMirrorEditor):
+
+2018-07-13  Matt Baker  <[email protected]>
+
         Web Inspector: Basic blocks highlighting should use line/column locations instead of offsets
         https://bugs.webkit.org/show_bug.cgi?id=187613
         <rdar://problem/42131808>

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/CodeMirrorEditor.js (233823 => 233824)


--- trunk/Source/WebInspectorUI/UserInterface/Views/CodeMirrorEditor.js	2018-07-13 22:54:16 UTC (rev 233823)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CodeMirrorEditor.js	2018-07-13 23:11:08 UTC (rev 233824)
@@ -27,8 +27,9 @@
 {
     static create(element, options)
     {
+        // Default line endings match typical expected line endings for _javascript_ (at least those supported by _javascript_Core).
         if (options.lineSeparator === undefined)
-            options.lineSeparator = "\n";
+            options.lineSeparator = /\r\n?|\n/;
 
         // CodeMirror's manual scrollbar positioning results in double scrollbars,
         // nor does it handle braces and brackets well, so default to using LTR.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to