Home Download Buy Blog Forum Support

Auto pair quotes not really working

Auto pair quotes not really working

Postby ninjaroll on Sat May 05, 2012 8:09 am

Hi guys,
Looking to make the switch from TextMate pretty soon, but wanted to fix these issues first. The auto pairing quotes are a little wonky and don't work all the time. For instance, if I wanted to add a style to a span tag, hitting the quote once would yield this:

Code: Select all
<span style="></span>
(notice single quote)

When I would really expect it to do this:
Code: Select all
<span style=""></span>
(notice double quotes)

For some reason, the pairing won't work when I'm typing before the ">" symbol. Highlighting a word and hitting a quote will wrap the word in quotes, and heck, even when I'm on a new line and hitting a quote will result in a double quote.

Any help would be great..thanks!
ninjaroll
 
Posts: 31
Joined: Tue Jan 03, 2012 7:10 pm

Re: Auto pair quotes not really working

Postby timkelty on Mon Jun 11, 2012 4:52 pm

Same here. Any solution?
timkelty
 
Posts: 3
Joined: Mon Jan 16, 2012 10:45 pm

Re: Auto pair quotes not really working

Postby C0D312 on Mon Jun 11, 2012 5:00 pm

In default - Keybindings:
Code: Select all
   // Auto-pair quotes
   { "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 },
         { "key": "preceding_text", "operator": "not_regex_contains", "operand": "[\"a-zA-Z0-9_]$", "match_all": true },
         { "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.double", "match_all": true }
      ]
   },


Override this by adding the following to Keybindings - User:
Code: Select all
   // Auto-pair quotes
   { "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 },
         { "key": "preceding_text", "operator": "not_regex_contains", "operand": "[\"a-zA-Z0-9_]$", "match_all": true },
         { "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.double", "match_all": true }
      ]
   },


(I changed the "following text")
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Re: Auto pair quotes not really working

Postby rondure on Fri Jun 15, 2012 11:02 am

Thanks COD312! That worked for me. :D
rondure
 
Posts: 2
Joined: Wed Jun 13, 2012 11:38 am


Return to Technical Support

Who is online

Users browsing this forum: mwb1100 and 18 guests