TextMate has a nice behavior when the caret is between curly braces and you press return {|} turns into { | }
I'd like to have the same behavior for round and square brackets. And I achieved that by replacing in the grammar the meta.brace.round.js and meta.brace.square.js scopes with pairs of punctuation.section.scope.begin.js and punctuation.section.scope.end.js, but this looks like a hack to me, so I was wondering if there's a correct way to achieve that.
On 12 Jul 2016, at 19:51, Igor Kozlov wrote:
I'd like to have the same behavior for round and square brackets. And I achieved that by replacing in the grammar the meta.brace.round.js and meta.brace.square.js scopes with pairs of punctuation.section.scope.begin.js and punctuation.section.scope.end.js, but this looks like a hack to me, so I was wondering if there's a correct way to achieve that.
It is certainly not a hack to apply semantic information to your document’s elements :)