Bug 187772 - Web Inspector: REGRESSION(r232591): CodeMirrorEditor should not use a RegExp lineSeparator option
Summary: Web Inspector: REGRESSION(r232591): CodeMirrorEditor should not use a RegExp ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Matt Baker
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-07-18 10:59 PDT by Matt Baker
Modified: 2018-07-18 11:40 PDT (History)
3 users (show)

See Also:


Attachments
Patch (3.37 KB, patch)
2018-07-18 11:06 PDT, Matt Baker
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.