Home Download Buy Blog Forum Support

Insert a tab ignoring all completions and snippets.

Insert a tab ignoring all completions and snippets.

Postby Anomareh on Mon Mar 28, 2011 11:25 am

Is there any way to just insert a tab?

Currently whenever I'm in a docblock in PHP I try to tab after the word array and it keeps trying to insert completions or snippets.

tab_completion is set to false and I deleted the array snippet in the PHP package, but when I go to tab it says inserting best completion in the status bar and tacks on a pair of parenthesis instead of a tab. I tried just binding tab to insert a tab but this was just a mess.

This is incredibly frustrating.
Anomareh
 
Posts: 222
Joined: Thu Oct 01, 2009 7:32 pm

Re: Insert a tab ignoring all completions and snippets.

Postby jps on Mon Mar 28, 2011 12:15 pm

It'll be PHP.sublime-completions triggering the behavior in this instance - this is a bug, it shouldn't be happening when tab completion is turned off.

I'm planning to make some changes to the completion logic that will help this, work arounds for the moment are to change the key bindings (getting rid of all the insert_best_completion related bindings), or, if you're on OSX, use Option+Tab to insert a tab. There aren't any free modifier+tab combinations available on windows/linux, unfortunately.
jps
Site Admin
 
Posts: 3062
Joined: Wed Mar 19, 2008 12:33 pm

Re: Insert a tab ignoring all completions and snippets.

Postby Anomareh on Mon Mar 28, 2011 12:39 pm

Ah alright, thanks.

I tried commenting out these 2 binds:

Code: Select all
{ "keys": ["tab"], "command": "insert_best_completion", "args": {"default": "\t", "exact": true} },
{ "keys": ["tab"], "command": "insert_best_completion", "args": {"default": "\t", "exact": false},
   "context":
   [
      { "key": "setting.tab_completion", "operator": "equal", "operand": true }
   ]
},

and tab just does nothing.
Anomareh
 
Posts: 222
Joined: Thu Oct 01, 2009 7:32 pm

Re: Insert a tab ignoring all completions and snippets.

Postby jps on Mon Mar 28, 2011 9:58 pm

You'll need to add another key binding that explicitly inserts a tab, along the lines of what the "enter" key is bound to
jps
Site Admin
 
Posts: 3062
Joined: Wed Mar 19, 2008 12:33 pm

Re: Insert a tab ignoring all completions and snippets.

Postby Anomareh on Tue Mar 29, 2011 12:58 am

Bleh my bad, that's was stupid on my part. It was late and I was trying to finish something up before taking off and it was just aggravating the hell out of me.
Anomareh
 
Posts: 222
Joined: Thu Oct 01, 2009 7:32 pm


Return to Technical Support

Who is online

Users browsing this forum: Majestic-12 [Bot], Yahoo [Bot] and 18 guests