RESOLVED FIXED 112138
Web Inspector: [CodeMirror] add smart braces functionality
https://bugs.webkit.org/show_bug.cgi?id=112138
Summary Web Inspector: [CodeMirror] add smart braces functionality
Andrey Lushnikov
Reported 2013-03-12 05:28:14 PDT
Add smart braces functionality for CodeMirror: - When a "(" typed, a pair of "()" should be inserted - When a ")" is typed and cursor is before a closing matched ")", nothing should be inserted, but the cursor should skip the brace - When a backspace is hit between brace pair "(|)", both braces should be deleted. Same should work for curly braces.
Attachments
Patch (5.78 KB, patch)
2013-03-12 05:31 PDT, Andrey Lushnikov
no flags
Patch (5.26 KB, patch)
2013-03-12 07:39 PDT, Andrey Lushnikov
no flags
Patch (7.78 KB, patch)
2013-03-18 04:48 PDT, Andrey Lushnikov
no flags
Andrey Lushnikov
Comment 1 2013-03-12 05:31:55 PDT
Andrey Lushnikov
Comment 2 2013-03-12 05:47:45 PDT
Comment on attachment 192717 [details] Patch Looks like there's a better way to do this.
Andrey Lushnikov
Comment 3 2013-03-12 07:39:22 PDT
Vsevolod Vlasov
Comment 4 2013-03-13 05:24:04 PDT
Comment on attachment 192733 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=192733&action=review > Source/WebCore/inspector/front-end/CodeMirrorTextEditor.js:68 > + this._smartBracesController = new WebInspector.CodeMirrorTextEditor.SmartBracesController(this._codeMirror); Please move this behind a setting > Source/WebCore/inspector/front-end/CodeMirrorTextEditor.js:515 > + if (WebInspector.TextUtils.isWordChar(char) || (!WebInspector.TextUtils.isBraceChar(char) && WebInspector.TextUtils.isStopChar(char))) if (!whitespace && !clsoingBrace) ?
Andrey Lushnikov
Comment 5 2013-03-18 04:48:14 PDT
WebKit Review Bot
Comment 6 2013-03-19 01:09:29 PDT
Comment on attachment 193532 [details] Patch Clearing flags on attachment: 193532 Committed r146188: <http://trac.webkit.org/changeset/146188>
WebKit Review Bot
Comment 7 2013-03-19 01:09:33 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.