+15

Use tab to step over auto-completed quote, bracket, etc. pairs

Jordan MacDonald 12 år siden opdateret af Brandon Galer 10 år siden 2
Scenario:

I'm coding something that involves a string, so I hit the single-quote button. SublimeText automatically puts in a terminating quote, and I continue typing my string. Once I'm done typing the string, I have to navigate past the auto-completed quote to continue typing. That requires me entering the single-quote button, the end key or the right-arrow key. This isn't so bad, but if I'm also in an array like so:
['test|'] (vertical bar = caret)
I need to type both a single-quote and a right-bracket.

Solution:

When the user hits the tab key, check to see if they're inside of an auto-completed string, array, etc and step over all adjacent elements so that the user can continue typing. So, if this is the situation:
'string|'
it'll just step over a quote. In this situation:
['string|']
it'll step over both the quote and the closing bracket. In this situation:
{['string|']}
it'll step over all three elements.

I've been looking to implement something like this. Aptana Studio does this by default. I've always loved this feature, makes coding feel really smooth.

Did a little bit of digging and found: http://www.sublimetext.com/forum/viewtopic.php?f=3&t=5174


The code to make this work is in the second reply to the thread.






Kundesupport af UserEcho