Sublime Forum

ST4 - Snippets won't get inserted at first

#1

I have this snippet, to get inserted when write ‘pr’:

image

In some files get inserted at first tab, but when there some variables or words with ‘pr’ at beginning, like ‘product’ or ‘principle’, sublime insert that word, so I have to ctrl-z and then tab again to get the snippet inserted.

Is there a way to change this behavior and get the snippet inserted at first tab?

(this error also happened in last version of ST3 )

Thanks!!!

0 Likes

ST4 issues I found, but have no time to write proper bug reports (yet)
#2

Since you’re using PHP, perhaps you’re getting dinged by the issue currently being discussed here?

0 Likes

#3

Tried some things of that discussions, like add ‘auto_complete_include_snippets’ to settings, but still nothing.
(Typescript package isn’t installed)

The workaround of hit ctrl+space before Tab works fine,
but it changes the workflow by adding more steps.

0 Likes

#4

I’m just “shooting from the hip” here. I had changed the behaviour of alt+enter, which meant it clashed with alt+enter in find in file
I’d reassigned it to return to column 0 (via a macro ReturnHome) :

 { "keys": ["alt+enter"], "command": "run_macro_file",
        "args": {"file": "res://Packages/User/ReturnHome.sublime-macro"},
        "context":
        [
          {"key": "eol_selector", "operator": "not_equal", "operand":"text.plain"}
        ]
  }, 

I got round this by changing the context, having found the “scope” of find in file with ctrl+shift+alt+p (it turned out to be text.plain). I could then exclude it in the keybinding…

Could you do something similar with your issue ?

Or course, I could be completely wrong !

0 Likes

#5

I have a different scope, so I don’t think your workaround will apply here.

Captura%20de%20pantalla%20de%202021-06-01%2010-12-42

0 Likes

#6

Could you edit your keybindings (I know a hassle) to get the keys to do what you want ? I’m not an ST4 user, so don’t know the issue you face. I’m suggesting ideas rather than anything concretely useful…:thinking:

0 Likes

#7

In the code of the snippet (first post) I put the letters that will trigger the snippet:

<tabTrigger>pr</tabTrigger>

Thats means when a user type “pr”, and then press the Tab key, the snippet must be inserted.

This behaviour works ok until the last versions of ST3.
In ST3 I use SublimeIntel for php coding, but in ST4 I remove that and now I use php-intelephense,
so there’s not a problem of php coding plugins.

0 Likes