Home Download Buy Blog Forum Support

Autocomplete Bug

Autocomplete Bug

Postby frodo2975 on Fri Apr 11, 2014 3:27 pm

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.
frodo2975
 
Posts: 1
Joined: Fri Apr 11, 2014 3:16 pm

Re: Autocomplete Bug

Postby diesirae on Mon Apr 14, 2014 2:58 pm

Same problem here!

Exact same problem!


Really wish this could be improved. Thanks!
diesirae
 
Posts: 3
Joined: Mon Apr 14, 2014 2:57 pm

Re: Autocomplete Bug

Postby iamntz on Mon Apr 14, 2014 3:06 pm

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.
iamntz
 
Posts: 908
Joined: Fri Apr 29, 2011 8:52 am
Location: Romania

Re: Autocomplete Bug

Postby diesirae on Thu Apr 17, 2014 5:01 pm

iamntz wrote: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.


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

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

Thanks for your reply!
diesirae
 
Posts: 3
Joined: Mon Apr 14, 2014 2:57 pm

Re: Autocomplete Bug

Postby diesirae on Thu Apr 17, 2014 5:20 pm

Ok, I found out how to manage that.

Just put this on my Preferences / Key bindings - User
Code: Select all
[
  { "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!
diesirae
 
Posts: 3
Joined: Mon Apr 14, 2014 2:57 pm

Re: Autocomplete Bug

Postby Jimbly on Thu Jun 19, 2014 10:05 pm

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):
Code: Select all
   "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).
Code: Select all
  { "keys": ["tab"], "command": "commit_completion", "context":
    [ { "key": "auto_complete_visible" } ]
  },
Jimbly
 
Posts: 2
Joined: Tue Mar 11, 2014 7:42 pm


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 20 guests