Sublime Forum

Matching bracket limit?

#1

In files with lot of level of brackets like JSON or JavaScript, it look like there is a limit when Matching Bracket (like ctrl+M) stop to work for outer brackets.
It work for the small sets but not for the big ones (like most outer brackets).
An example is Ext JS 4 sources.

Jon, is this a bug or could you give us please the rules behind this behavior (number of brackets or data size between them ?).
Is this configurable ?

0 Likes

#2

There isn’t a limit on the number of brackets, but there is a limit on how much of the buffer will be searched for the matches - it’s currently 4000 characters for visualisation, and 10000 characters for jump to matching bracket.

Can you link/email me an example of the code that’s giving you an issue?

0 Likes

#3

I probably hit the limit, if I remember well there is more than 4000 lines in the files where I noticed it, so probably more than 10000 char.
Maybe the limit for jump matching must be increased since it’s probably not hit the global performance of ST (I suppose it only search when the command is executed).

Default (Windows).sublime-keymap :wink:
The outer bracket didn’t work.

The others are both in Ext JS 4 package from Sencha, it’s big JSON and big javascript.
Didn’t find it online, but I could send you some of them on Monday if you need it.

Thanks for your reply.

0 Likes

#4

This an example from ExtJS 4.
The outer brackets doesn’t work, there is more than 36000 char. between them.
Button.zip (10.4 KB)

0 Likes

#5

I also noticed this issue with brackets:

screencast.com/t/6Gpe7XWEsx2g

The code is pretty small (like 50 lines or so), I don’t think there is a full buffer issue.

0 Likes

#6

If the bracket matching isn’t working for you, and it’s not because of the character limit, please post some example code that demonstrates the issue, and indicate where in the code it’s not working. I can’t do anything with a video.

0 Likes

#7

Oups, sorry about that. :mrgreen:
Here is the code iamntz.com/experiments/bracket.js.txt

0 Likes

#8

Thanks for the listing - all the brackets are matching correctly for me though.

0 Likes

#9

Hmmm… I think i just found the problem: “match_brackets_angle”: true
If i set this to false, is working on me too.

0 Likes

#10

I am facing a similar issue with sublime text 3, I find that ctrl+m to jump betweem matcing brackets works for round brackets “()” but not for curly brackets “{}”, I wonder if this might be caused by some interference from other packages/plugins I have installed such as bracket highlighter etc. Anyways I wanted to ask you where this setting - “match_brackets_angle”: true is found so I can modify it.

0 Likes