Bug 82708 - Web Inspector: editing resets line-ending of the whole file
Summary: Web Inspector: editing resets line-ending of the whole file
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Pavel Feldman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-30 02:44 PDT by Pavel Feldman
Modified: 2012-03-30 04:37 PDT (History)
10 users (show)

See Also:


Attachments
Patch (27.54 KB, patch)
2012-03-30 03:04 PDT, Pavel Feldman
yurys: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Feldman 2012-03-30 02:44:27 PDT
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.
Comment 1 Pavel Feldman 2012-03-30 03:04:16 PDT
Created attachment 134761 [details]
Patch
Comment 2 Pavel Feldman 2012-03-30 04:36:32 PDT
Committed r112652: <http://trac.webkit.org/changeset/112652>
Comment 3 Alexander Pavlov (apavlov) 2012-03-30 04:37:18 PDT
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.