Bug 112153 - Web Inspector: [CodeMirror] Handle "enter" key in {|} situation
Summary: Web Inspector: [CodeMirror] Handle "enter" key in {|} situation
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: Andrey Lushnikov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-12 07:47 PDT by Andrey Lushnikov
Modified: 2013-03-13 09:26 PDT (History)
9 users (show)

See Also:


Attachments
Patch (2.53 KB, patch)
2013-03-12 07:49 PDT, Andrey Lushnikov
no flags Details | Formatted Diff | Diff
Patch (2.61 KB, patch)
2013-03-13 09:01 PDT, Andrey Lushnikov
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Lushnikov 2013-03-12 07:47:07 PDT
Step-by-step:
1. Type following:
function foo(a, b){|}

2. Hit enter

Expected:
function foo(a, b){
   |
}

Actual:
function foo(a, b){
|}
Comment 1 Andrey Lushnikov 2013-03-12 07:49:56 PDT
Created attachment 192735 [details]
Patch
Comment 2 Vsevolod Vlasov 2013-03-13 05:09:45 PDT
Comment on attachment 192735 [details]
Patch

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

> Source/WebCore/inspector/front-end/CodeMirrorTextEditor.js:493
> +        if (line.substr(cursor.ch - 1, 2) === "{}") {

You should if the selection range is empty here.
Comment 3 Andrey Lushnikov 2013-03-13 09:01:21 PDT
Created attachment 192931 [details]
Patch
Comment 4 WebKit Review Bot 2013-03-13 09:25:59 PDT
Comment on attachment 192931 [details]
Patch

Clearing flags on attachment: 192931

Committed r145724: <http://trac.webkit.org/changeset/145724>
Comment 5 WebKit Review Bot 2013-03-13 09:26:03 PDT
All reviewed patches have been landed.  Closing bug.