Bug 187772

Summary: Web Inspector: REGRESSION(r232591): CodeMirrorEditor should not use a RegExp lineSeparator option
Product: WebKit Reporter: Matt Baker <mattbaker>
Component: Web InspectorAssignee: Matt Baker <mattbaker>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, inspector-bugzilla-changes, joepeck
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch none

Description Matt Baker 2018-07-18 10:59:25 PDT
Summary:
CodeMirrorEditor should not use a RegExp lineSeparator option. Instead we should leave this option undefined. When no lineSeparator is specified, CodeMirror will effectively split lines on /\r\n?|\n/, but joins on \n when recreating the source text.

Regressed in https://trac.webkit.org/changeset/232591.
Comment 1 Matt Baker 2018-07-18 11:00:01 PDT
<rdar://problem/42331640>
Comment 2 Matt Baker 2018-07-18 11:06:27 PDT
Created attachment 345261 [details]
Patch
Comment 3 Joseph Pecoraro 2018-07-18 11:12:52 PDT
Comment on attachment 345261 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=345261&action=review

r=me

> Source/WebInspectorUI/ChangeLog:15
> +        it detects \n, \r\n, and \r. By specifying a regular expression we
> +        merely cause problems when CodeMirror uses the supplied lineSeparator
> +        when joining its array of lines together.

Well that stinks.
Comment 4 Matt Baker 2018-07-18 11:14:12 PDT
Comment on attachment 345261 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=345261&action=review

>> Source/WebInspectorUI/ChangeLog:15
>> +        when joining its array of lines together.
> 
> Well that stinks.

Indeed.
Comment 5 WebKit Commit Bot 2018-07-18 11:40:21 PDT
Comment on attachment 345261 [details]
Patch

Clearing flags on attachment: 345261

Committed r233920: <https://trac.webkit.org/changeset/233920>
Comment 6 WebKit Commit Bot 2018-07-18 11:40:23 PDT
All reviewed patches have been landed.  Closing bug.