Aditya M P
Aditya M P

Reputation: 5347

Sublime Text 2 PHP Else autocompletes a function

When I type else and hit Tab, Sublime inserts printer_draw_elipse(printer_handle, ul_x, ul_y, lr_x, lr_y). How do I avoid this, and make it only insert the Tab character?

I noticed the file with the path ~/.config/sublime-text-2/Packages/PHP/php-else.sublime-snippet, but removing that had no effect.

Upvotes: 2

Views: 57

Answers (1)

Joe C.
Joe C.

Reputation: 1538

This is the unfortunate result of partial-text matching and autocomplete. The way I've gotten past it is to add the following line to the end of the completions list in ~/.config/sublime-text-2/Packages/PHP/PHP.sublime-completions (after the zlib_get_coding_type trigger, though you can place it anywhere in that list of triggers and it will work):

{ "trigger": "else", "contents": "else  " }

Essentially, we're short-circuiting the autocomplete with our own snippet that just replaces the "else"+TAB sequence with "else" and a trailing tab.

Upvotes: 2

Related Questions