Home Download Buy Blog Forum Support

Unusable Javascript Object Literal Auto Complete

Unusable Javascript Object Literal Auto Complete

Postby robhicks on Fri Aug 24, 2012 3:22 am

When entering Javascript object literals, I want to align the keys, colons and values like so:

Code: Select all
key          :          value
key1         :          value


When using Sublime 2 (even with auto_complete set to false), I can enter the key and the colon, but then when I tab, ST2 removes the tab and replaces it with:
Code: Select all
key          key: "value",


Is there any way to disable this. It creates so much work that I have to switch to another editor to enter the object literals.
robhicks
 
Posts: 4
Joined: Fri Aug 24, 2012 3:08 am

Re: Unusable Javascript Object Literal Auto Complete

Postby bizoo on Fri Aug 24, 2012 6:44 am

This behavior is caused by a standard snippet:
Code: Select all
\Sublime Text 2\Packages\JavaScript\Object-key-key-value.sublime-snippet

when you hit TAB after the colon, ST2 trigger this snippet.

Your solutions:
- After the colon press shift+TAB to insert a literal TAB and not trigger the snippet.
- Use the snippet: just type colon and TAB without the "key" and complete the snippet.
- I don't think there's a way to disable a snippet, you have to delete the file but remember that next ST2 update will probably create it back.
bizoo
 
Posts: 874
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

Re: Unusable Javascript Object Literal Auto Complete

Postby robhicks on Fri Aug 24, 2012 8:55 pm

Thanks for the answer. I'll play with it.
robhicks
 
Posts: 4
Joined: Fri Aug 24, 2012 3:08 am

Re: Unusable Javascript Object Literal Auto Complete

Postby robhicks on Thu Sep 20, 2012 1:09 pm

I finally disabled this by changing the snippet file extension.
robhicks
 
Posts: 4
Joined: Fri Aug 24, 2012 3:08 am


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 19 guests