"Highlight matching bracket" option doesn't highlight brackets with more than 2000 characters between them
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GtkSourceView |
Fix Released
|
Wishlist
|
|||
gtksourceview (Ubuntu) |
Fix Released
|
Wishlist
|
Ubuntu Desktop Bugs |
Bug Description
gedit fails to highlight matching brackets which have more than 2000 characters between them. If I have a long-ish block of code in which the opening and closing brackets are greater than 2000 characters apart, I'm unable to leave the input cursor sitting next to one and have the other be highlighted when I scroll to it. If they are less than 2000 characters apart, things work as expected.
Steps to reproduce:
1) Open gedit
2) Enable the "highlight matching bracket" option in preferences
3) Insert a "{" on line 1
4) Insert 2000 characters of your choice, followed by a "}"
5) Leave the cursor next to one of the brackets and then scroll to the other bracket. The bracket will not be highlighted. If you remove a character and repeat, the bracket will be highlighted as expected.
Seems like this is a simple fix.
Changed in gtksourceview: | |
status: | Unknown → Unconfirmed |
Changed in gtksourceview: | |
status: | New → Confirmed |
Changed in gtksourceview: | |
status: | Confirmed → Triaged |
Changed in gtksourceview: | |
importance: | Unknown → Wishlist |
status: | Confirmed → Fix Released |
Thank you for your bug. That's a design decision from upstream apparently:
gtksourceview/ gtksourcebuffer .c:#define MAX_CHARS_ BEFORE_ FINDING_ A_MATCH 2000
The limit is probably used for performance reasons and upstream though 2000 chars is a good limit for a block. Do you have many code block over that number? What would be a good limit for you?