Home Download Buy Blog Forum Support

Tab completion without coma

Tab completion without coma

Postby Acaro00 on Sat Feb 23, 2013 10:13 am

Right now when I am using tab completion inside a function and I hit "Tab" I get this selected.
Image

Most of the times this is not useful, because you need to write the comma and maybe the quotes again. Not good.

Is there a shortcut or a way to create a shortcut to select this instead?
Image

That would be awesome!
Acaro00
 
Posts: 6
Joined: Sat Feb 23, 2013 10:08 am

Re: Tab completion without coma

Postby agibsonsw on Sat Feb 23, 2013 12:46 pm

You, or whoever this Package is from, will need to amend this function definition in the completion or snippet file.
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
agibsonsw
 
Posts: 901
Joined: Fri Jan 27, 2012 9:11 pm

Re: Tab completion without coma

Postby Acaro00 on Sat Feb 23, 2013 1:25 pm

Uhm... interesting. I think it's some package from Wordpress.

I'm quite new to ST, how can I know which package is coming this from? Where can I see the packages I've installed? (and by the way, remove some).
Acaro00
 
Posts: 6
Joined: Sat Feb 23, 2013 10:08 am

Re: Tab completion without coma

Postby Acaro00 on Sat Feb 23, 2013 1:27 pm

Oh fine, I found them in "Application Support" but is there a GUI for managing packages inside ST?
Acaro00
 
Posts: 6
Joined: Sat Feb 23, 2013 10:08 am

Re: Tab completion without coma

Postby Acaro00 on Sat Feb 23, 2013 1:29 pm

Ok... really found the place:

Code: Select all
{"trigger": "wp_mail", "contents": "wp_mail( ${1:\\$to}${2:, \\$subject}${3:, \\$message}${4:, \\$headers = ''}${5:, \\$attachments = array} )" },


I could change that but... OMG would I have to change them all? I mean... this package has hundreds of things like this. I could try with a regexp but... is there another way to select the variable instead of the comma and the variable? Sometimes it's useful for deleting parameters you don't want or need. Maybe with another key, like ^+cmd+Tab?
Acaro00
 
Posts: 6
Joined: Sat Feb 23, 2013 10:08 am

Re: Tab completion without coma

Postby Acaro00 on Sat Feb 23, 2013 1:39 pm

Ok... fine again. It wasn't difficult at all, sorry :D

But my last question is still valid: Is another way to do completions with another shortcut different than Tab? That would be killer, so you select the comma if you are going to delete it and you select the parameter if you are going to change it.
Acaro00
 
Posts: 6
Joined: Sat Feb 23, 2013 10:08 am

Re: Tab completion without coma

Postby Acaro00 on Sat Feb 23, 2013 4:33 pm

Looking at a snippet I've figured out a way which could work and with some reg exp's I've managed to get what I want:

They look like this now:
Code: Select all
{"trigger": "wp_mail", "contents": "wp_mail( ${1:\\$to}${2:, ${3:\\$subject}}${4:, ${5:\\$message}}${6:, ${7:\\$headers = ''}}${8:, ${9:\\$attachments = array}} )" }


And you can use single-tabs and double-tabs to navigate through parameters.

I will test them for some days and if they work fine I will do a Pull Request.
Acaro00
 
Posts: 6
Joined: Sat Feb 23, 2013 10:08 am


Return to Technical Support

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot] and 14 guests