Sublime Forum

Autocomplete Bug

#1

Found a bug where autocomplete doesn’t work, and instead skips straight to the end of the line

Steps to reproduce:

  1. Start typing a built in function name:
    json_en

  2. Press tab to autocomplete. Should look like this, with “value” selected
    json_encode(value)

  3. Start typing something else that autocomplete recognizes, then press tab to autocomplete
    json_encode($my_variab)

Instead of completing “$my_variable”, it jumps outside the parenthesis.

Thanks for developing sublime, it’s definitely my favorite text editor.

0 Likes

#2

Same problem here!

Exact same problem!

Really wish this could be improved. Thanks!

0 Likes

#3

ctrl+space should be used when inside of paranthesis.

That’s because when you have multiple function arguments as suggestions, you could simply jump with tab/shift+tab forward & backward.

0 Likes

#4

[quote=“iamntz”]ctrl+space should be used when inside of paranthesis.

That’s because when you have multiple function arguments as suggestions, you could simply jump with tab/shift+tab forward & backward.[/quote]

iamntz, I make a video for a better undertanding: youtu.be/LoA1DaQRoSk

In this case, when I’m inside the paranthesis, ctrl+space makes nothing, only tab!

Thanks for your reply!

0 Likes

#5

Ok, I found out how to manage that.

Just put this on my Preferences / Key bindings - User

{ "keys": "ctrl+space"], "command": "insert_best_completion", "args": {"default": "\t", "exact": true} } ]
and it started to work as iamntz said. Thanks for that!

Anyway, I think that most recent autocompletes must be on the top of the pile of the other active autocompletes / tab stops. I think that would be a better default behavior, just my opinion!

Thanks again!

0 Likes

#6

In Sublime Text 2, I think I solved this by simply swapping the order of the two “tab” keybinds so that “commit_completion, context: auto_complete_visible” has higher priority than “next_field”, since if you’ve got an auto-complete pop-up open and hit tab, that’s, I think, always what you’d want anyway.

In Sublime Text 3, the OS-default keymap files are not modifiable (which is understandable), and they’ve also became more complicated. It looks like you can either work around this by adding these two options to your preferences (with minor side-effects):

"auto_complete_commit_on_tab": true, "auto_complete_with_fields": true,
Or add this to your keymap (which should be higher priority than the built-in keymap for tab).

{ "keys": "tab"], "command": "commit_completion", "context": { "key": "auto_complete_visible" } ] },

0 Likes