Changeset 233920 in webkit
- Timestamp:
- Jul 18, 2018 11:40:14 AM (6 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r233861 r233920 1 2018-07-18 Matt Baker <mattbaker@apple.com> 2 3 Web Inspector: REGRESSION(r232591): CodeMirrorEditor should not use a RegExp lineSeparator option 4 https://bugs.webkit.org/show_bug.cgi?id=187772 5 <rdar://problem/42331640> 6 7 Reviewed by Joseph Pecoraro. 8 9 * UserInterface/Views/CodeMirrorEditor.js: 10 (WI.CodeMirrorEditor.create): 11 (WI.CodeMirrorEditor): 12 CodeMirror should be left to auto-detect line separators. By default 13 it detects \n, \r\n, and \r. By specifying a regular expression we 14 merely cause problems when CodeMirror uses the supplied lineSeparator 15 when joining its array of lines together. 16 17 * UserInterface/Views/TextEditor.js: 18 (WI.TextEditor.set string.update): 19 (WI.TextEditor.prototype.set string): 20 This assertion was only true when we forced "\n" line endings everywhere. 21 It no longer holds for source text with "\r\n" (Windows-style) line endings. 22 1 23 2018-07-16 Matt Baker <mattbaker@apple.com> 2 24 -
trunk/Source/WebInspectorUI/UserInterface/Views/CodeMirrorEditor.js
r233824 r233920 28 28 static create(element, options) 29 29 { 30 // Default line endings match typical expected line endings for JavaScript (at least those supported by JavaScriptCore).31 if (options.lineSeparator === undefined)32 options.lineSeparator = /\r\n?|\n/;33 34 30 // CodeMirror's manual scrollbar positioning results in double scrollbars, 35 31 // nor does it handle braces and brackets well, so default to using LTR. -
trunk/Source/WebInspectorUI/UserInterface/Views/TextEditor.js
r233861 r233920 119 119 this._codeMirror.removeLineClass(0, "wrap"); 120 120 121 if (this._codeMirror.getValue() !== newString) {121 if (this._codeMirror.getValue() !== newString) 122 122 this._codeMirror.setValue(newString); 123 console.assert(this.string.length === newString.length, "A lot of our code depends on precise text offsets, so the string should remain the same."); 124 } else { 123 else { 125 124 // Ensure we at display content even if the value did not change. This often happens when auto formatting. 126 125 this.layout();
Note: See TracChangeset
for help on using the changeset viewer.