Sublime Forum

Probles with braces

#1

Hi,

If I hit “” a few times I get “]]]” and If I hit “(” a few times I get “((()))” and if I hit “{” a few times I get “{{{}”

This is a bug or a feature?

P.S. sry for my english (

0 Likes

#2

[quote=“squ1b3r”]Hi,

If I hit “” a few times I get “]]]” and If I hit “(” a few times I get “((()))” and if I hit “{” a few times I get “{{{}”

This is a bug or a feature?

P.S. sry for my english ([/quote]

Seems like a bug to be honest.

0 Likes

#3

[quote=“jbrooksuk”]
Seems like a bug to be honest.[/quote]

A simple mistake in the Default (OS).sublime-keymap (Default Key Bindings):
In the block:

[code] // Auto-pair curly brackets
{ “keys”: “{”], “command”: “insert_snippet”, “args”: {“contents”: “{$0}”}, “context”:

		{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
		{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
		{ "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|$)", "match_all": true }
	]
},

[/code]
the \} miss from the RE:

{ "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|$)", "match_all": true }
Jon will probably correct it in the next release but meanwhile you can modify it.
The file will be replaced in the next update.

0 Likes

#4

Tnx a lot!

0 Likes

#5

Build 2025 on sublimetext.com/dev correct this issue.

But the RE was modified only for the curly braces (like I do in my previous post), does the RE for other brackets shouldn’t be modified in the same way ?
It’s now a little bit inconsistent between brackets auto-closing.

0 Likes

#6

Good point, will fix

0 Likes