Bug 113028 - Web Inspector: Correctly implement scrollToLine, revealLine and setSelection on CodeMirror editor.
Summary: Web Inspector: Correctly implement scrollToLine, revealLine and setSelection ...
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: Vsevolod Vlasov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-22 02:33 PDT by Vsevolod Vlasov
Modified: 2013-03-22 08:25 PDT (History)
8 users (show)

See Also:


Attachments
Patch (8.29 KB, patch)
2013-03-22 02:42 PDT, Vsevolod Vlasov
pfeldman: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vsevolod Vlasov 2013-03-22 02:33:51 PDT
Patch to follow
Comment 1 Vsevolod Vlasov 2013-03-22 02:42:43 PDT
Created attachment 194484 [details]
Patch
Comment 2 Andrey Lushnikov 2013-03-22 03:15:47 PDT
Comment on attachment 194484 [details]
Patch

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

> Source/WebCore/inspector/front-end/CodeMirrorTextEditor.js:78
> +    this._codeMirror.on("beforeSelectionChange", this._selectionChange.bind(this));

There's already a selection listener in ToT, but it observes "cursorActivity" event.

> Source/WebCore/inspector/front-end/CodeMirrorTextEditor.js:324
> +    _coordsChar: function(coords)

Maybe "coordsCharLocal"?

> Source/WebCore/inspector/front-end/CodeMirrorTextEditor.js:332
> +            var middle = (begin + end) / 2;
> +            middle = middle >>> 0;

maybe (begin + end) >> 1 ?
Comment 3 Vsevolod Vlasov 2013-03-22 08:25:19 PDT
Committed r146615: <http://trac.webkit.org/changeset/146615>