Sublime Forum

Tab Trigger do not work in Windows but OS X

#1

Hello,

I am using the latest Sublime Text V4126 both on Windows and OS X.

I know how to use snippets for my LaTeX projects. They are working in OS X, but not in Windows!

Windows: If I type the trigger word and then the tab key, nothing happens. Except that the cursor moves a little further.

This is my ordinary snippet file “test.sublime-snippet” in C:\Users\Betrieb\AppData\Roaming\Sublime Text 3\Packages\User:

I have tried to set

“tab_completion”: false,

and

“tab_completion”: true,

But I only can change it on the right windows, not in the left:

The snippet only works with “Tools | Snippets…” but does not work with tab trigger.

Thank you

Christoph

0 Likes

#2

Note: The left pane in settings is the readonly representation of default values.

Can confirm this being broken in ST4126, but it seems fixed in ST4140.

So if you have a license, you can update to the dev build or just wait a bit longer for the next stable build to be released.

0 Likes

#3

Hello,

I have tried with ST4140. Also here: The snippets do not work with a tab trigger.

0 Likes

#4

Did you try it in SAFE MODE?

I did so using your snippet.

With tab_completion: false (default), the full tabTrigger hello needs to be typed to enable hitting tab expanding it.

With tab_completion: true typing hel and hitting tab is enough to get the snippet expanded.

Both in plain text.

Maybe a plugin or key binding is overriding something crucial?

0 Likes

#5

When I open Sublime Text in SAFE MODE then I can create a new snippet and the tab trigger works perfect.

I have nothing changed in key binding preferences.

Do you know what my solution could be? Why does it work in SAFE MODE?

0 Likes

#6

You may check your plugins. Maybe one of them is overriding the tab key to run a custom command.

To check that, you could open ST’s console and run sublime.log_commands(True)

When hitting tab after hello was typed, you should see something like

command: expand_snippet

In case hel was typed and tab_completion: true is set, you should see

command: auto_complete {"commit_single": true, "default": "\t", "mini": true}

Otherwise you can just disable plugins one-by-one to find the culprit.

0 Likes

#7

Thank you! I will try it! I have to google how to do it …

I only have two plugins: Package Control and LaTeXTools. I disabled them with “ignored_packages”:[…], - but that did not help.

The console shows after typing “hello + tab”:

>>> sublime.log_commands(True)
command: insert_best_completion {“default”: “\t”, “exact”: true}

This has something to do with “Preferences | Key Bindings” because there I can find this line.

0 Likes

#8

insert_best_completion does no longer exist in ST4.

You could look for C:\Users\Betrieb\AppData\Roaming\Sublime Text 3\Packages\Default package.

It is known that in some rare cases ST’s defaults have been extracted there, overriding any newer stuff.

If that package exists, remove it.

Otherwise you have a custom key binding set up anywhere which points to the outdated command.

0 Likes

#9

Thank you so much!!!

I have deleted this specific file and now everything works!

0 Likes

#10

I suspect the issue is in line 6 of your custom snippet. Try to remove --> at the end of the line.

0 Likes