Home Download Buy Blog Forum Support

Probles with braces

Probles with braces

Postby squ1b3r on Wed Feb 16, 2011 5:12 pm

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 (
squ1b3r
 
Posts: 45
Joined: Fri Feb 11, 2011 6:35 am

Re: Probles with braces

Postby jbrooksuk on Wed Feb 16, 2011 7:08 pm

squ1b3r wrote: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 (

Seems like a bug to be honest.
jbrooksuk
 
Posts: 782
Joined: Sun Apr 11, 2010 10:37 am
Location: England

Re: Probles with braces

Postby bizoo on Wed Feb 16, 2011 8:36 pm

jbrooksuk wrote:Seems like a bug to be honest.

A simple mistake in the Default (OS).sublime-keymap (Default Key Bindings):
In the block:
Code: Select all
   // 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 }
      ]
   },

the \\} miss from the RE:
Code: Select all
         { "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.
bizoo
 
Posts: 889
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: Probles with braces

Postby squ1b3r on Thu Feb 17, 2011 6:32 am

Tnx a lot!
squ1b3r
 
Posts: 45
Joined: Fri Feb 11, 2011 6:35 am

Re: Probles with braces

Postby bizoo on Thu Feb 17, 2011 1:56 pm

Build 2025 on http://www.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.
bizoo
 
Posts: 889
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: Probles with braces

Postby jps on Thu Feb 17, 2011 2:03 pm

Good point, will fix
jps
Site Admin
 
Posts: 3077
Joined: Wed Mar 19, 2008 12:33 pm


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot] and 37 guests