RESOLVED FIXED 109200
Web Inspector: implement smart braces functionality
https://bugs.webkit.org/show_bug.cgi?id=109200
Summary Web Inspector: implement smart braces functionality
Andrey Lushnikov
Reported 2013-02-07 08:56:57 PST
By "smart braces" I mean: - When I type "(", a closing brace should be added immediately and the cursor should be located inside "()" pair. - When then I hit "Backspace", both braces should be deleted - If, instead, I type ")" - cursor should go over closing brace without adding a new one.
Attachments
Patch (12.97 KB, patch)
2013-02-07 09:02 PST, Andrey Lushnikov
no flags
Patch (13.48 KB, patch)
2013-02-07 10:27 PST, Andrey Lushnikov
no flags
Patch (15.54 KB, patch)
2013-02-12 01:47 PST, Andrey Lushnikov
no flags
Patch (15.69 KB, patch)
2013-02-12 01:55 PST, Andrey Lushnikov
no flags
Patch (15.72 KB, patch)
2013-02-12 02:52 PST, Andrey Lushnikov
no flags
Patch (18.65 KB, patch)
2013-02-14 05:37 PST, Andrey Lushnikov
no flags
Andrey Lushnikov
Comment 1 2013-02-07 09:02:51 PST
Andrey Lushnikov
Comment 2 2013-02-07 10:27:22 PST
Andrey Lushnikov
Comment 3 2013-02-12 01:47:57 PST
Andrey Lushnikov
Comment 4 2013-02-12 01:48:50 PST
Comment on attachment 187809 [details] Patch test expectations not updated
Andrey Lushnikov
Comment 5 2013-02-12 01:55:56 PST
Andrey Lushnikov
Comment 6 2013-02-12 02:52:34 PST
Pavel Feldman
Comment 7 2013-02-12 06:45:05 PST
Comment on attachment 187819 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=187819&action=review > Source/WebCore/inspector/front-end/DefaultTextEditor.js:1398 > + this._textInputInterceptors["("] = this._handleBracePairInsertion.bind(this, "()"); registerInterceptor("(", "()", this._handleBracePairInsertion); would look more user-friendly > Source/WebCore/inspector/front-end/DefaultTextEditor.js:2829 > + var interceptor = this._textInputInterceptors[event.data]; textInput will trigger for pasting text as well and you don't want interceptors to work there. Instad of text input interceptors, you want keyDown handlers.
Andrey Lushnikov
Comment 8 2013-02-14 05:37:15 PST
Andrey Lushnikov
Comment 9 2013-02-14 06:21:46 PST
Comment on attachment 187819 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=187819&action=review >> Source/WebCore/inspector/front-end/DefaultTextEditor.js:1398 >> + this._textInputInterceptors["("] = this._handleBracePairInsertion.bind(this, "()"); > > registerInterceptor("(", "()", this._handleBracePairInsertion); would look more user-friendly not sure I got your idea.. Do you mean we should create a public "registerInterceptor" method? >> Source/WebCore/inspector/front-end/DefaultTextEditor.js:2829 >> + var interceptor = this._textInputInterceptors[event.data]; > > textInput will trigger for pasting text as well and you don't want interceptors to work there. Instad of text input interceptors, you want keyDown handlers. fixed to handling in keyPress
Pavel Feldman
Comment 10 2013-02-15 04:02:54 PST
Comment on attachment 188329 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=188329&action=review > Source/WebCore/inspector/front-end/DefaultTextEditor.js:3549 > + } else return false > Source/WebCore/inspector/front-end/DefaultTextEditor.js:3595 > + } else return false;
WebKit Review Bot
Comment 11 2013-02-15 04:32:07 PST
Comment on attachment 188329 [details] Patch Clearing flags on attachment: 188329 Committed r142983: <http://trac.webkit.org/changeset/142983>
WebKit Review Bot
Comment 12 2013-02-15 04:32:12 PST
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.