This change splits setText into setText (for initialization) and editRange (for editing). Distinguishing between the two allowed properly detecting the preferred line endings. Drive-by: annotated the TextEditorModel classes.
Created attachment 134761 [details] Patch
Committed r112652: <http://trac.webkit.org/changeset/112652>
View in context: https://bugs.webkit.org/attachment.cgi?id=134761&action=review > Source/WebCore/inspector/front-end/TextEditorModel.js:93 > +WebInspector.TextEditorCommand = function(newRange, originalText) I would call it "TextEditCommand" as the editor may have a few different commands. > Source/WebCore/inspector/front-end/TextEditorModel.js:180 > + this.dispatchEventToListeners(WebInspector.TextEditorModel.Events.TextChanged, { oldRange: range, newRange: newRange}); a space between "newRange" and "}" > LayoutTests/ChangeLog:3 > + Web Inspector: editing resets line-ending of the whole file A test for a bare "\r" would work fine.