Home Download Buy Blog Forum Support

Dev Build 2162

Re: Dev Build 2162

Postby digicat on Tue Jan 10, 2012 7:00 am

I think I found a bug with the autocompletion.

After hitting the tab key to autocomplete a function name, the autocomplete doesn't automatically trigger for the function parameters.
I need to hit the ctrl+space to trigger the autocomplete for the function parameters. Previously, it was being triggered automatically.

I hope you can fix it, as the autocomplete is a real time saver.
Thanks!
digicat
 
Posts: 1
Joined: Tue Jan 10, 2012 6:55 am

Re: Dev Build 2162

Postby sublimator on Tue Jan 10, 2012 7:47 am

After hitting the tab key to autocomplete a function name, the autocomplete doesn't automatically trigger for the function parameters.
I need to hit the ctrl+space to trigger the autocomplete for the function parameters.


I personally prefer `enter` for the accept completion key for exactly this reason plus the fact that enter is ingrained from other programs.

There was talk of using shift+enter/ctrl+shift+enter for snippet traversal in lieu of tab/shift+tab to alleviate this. That's a lot of muscle memory to fight, for a lot of people though. Web forms all use tab/shift+tab for field movement.

What can you do?
It is better to remain silent and be thought a fool, than to speak out and remove all doubt
sublimator
 
Posts: 649
Joined: Thu Mar 20, 2008 5:41 am

Re: Dev Build 2162

Postby sublimator on Tue Jan 10, 2012 7:59 am

One of the many awesome thing about Sublime is how customisable it is!

Seems in the latest builds you can just use shift+enter to insert a `\n` in the case that the completion dialogue is open (having set <enter> as accept completion)

I personally don't have the time to retrain to using tab so I'm stoked that it's configurable.
It is better to remain silent and be thought a fool, than to speak out and remove all doubt
sublimator
 
Posts: 649
Joined: Thu Mar 20, 2008 5:41 am

Re: Dev Build 2162

Postby qqq on Tue Jan 10, 2012 9:44 am

Why was using Enter for completions bad?

You could use completion inside snippets this way. While you moved through snippet points with TAB you could at the same time use completions with ENTER without interrupting the snippet.

This feature saved much time in my case (about 70% of the typing I do is inside a snippet). I think it should be at least configurable.
ST2 Win7 64-bit
qqq
 
Posts: 57
Joined: Tue Mar 08, 2011 9:49 am

Re: Dev Build 2162

Postby spadgos on Tue Jan 10, 2012 10:06 am

I'm having issues with snippets.

After inserting a snippet like this:
Code: Select all
@param {${1:String}} ${2:foobar} ${3:[description]}


The edit shows this:

Code: Select all
@param {String} foobar [description]


And "String" is highlighted. Previously, pressing tab would just move to the next field ("foobar"), however now it is replacing "String" with a space first. Pressing it again will move to the next field, but a third time will clear that field, and so on. Here is the output from log_commands, starting with selecting the snippet:

Code: Select all
command: commit_completion
command: insert_best_completion {"default": "   ", "exact": false}
command: next_field
command: insert_best_completion {"default": "   ", "exact": false}
command: next_field
command: insert_best_completion {"default": "   ", "exact": false}


Note that there were no autocomplete dialogs visible after the initial snippet insertion.
spadgos
 
Posts: 121
Joined: Thu Oct 06, 2011 12:49 am

Re: Dev Build 2162

Postby skaet on Tue Jan 10, 2012 2:07 pm

spadgos wrote:I'm having issues with snippets.

Unable to reproduce this on Win 7 x64 with build 2161 or 2162. Bug reports should include your OS, the ST2 version when the functionality was last working and the ST2 version when it broke. Helps narrow down the cause much quicker :)
skaet
 
Posts: 93
Joined: Thu Sep 16, 2010 3:37 pm

Re: Dev Build 2162

Postby chrisguilbeau on Tue Jan 10, 2012 7:31 pm

For anyone who isn't liking the new "tab" instead of "enter" for auto complete, you can stick this in your user keymap

{ "keys": ["enter"], "command": "commit_completion", "context": [{ "key": "auto_complete_visible" }] },
chrisguilbeau
 
Posts: 19
Joined: Fri Nov 11, 2011 5:06 am

Re: Dev Build 2162

Postby handycam on Tue Jan 10, 2012 8:08 pm

chrisguilbeau wrote:For anyone who isn't liking the new "tab" instead of "enter" for auto complete, you can stick this in your user keymap

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



Thank you!
Mac OS 10.9.3
ST 3 (3059)
handycam
 
Posts: 271
Joined: Tue Jan 03, 2012 2:42 pm

Re: Dev Build 2162

Postby danro on Tue Jan 10, 2012 8:45 pm

I think Enter should still be the default for accepting completions.

I'm assuming the main issue comes into play with whitespace-based languages, or people who place open brackets on newlines. If I were one of those use cases, I would still prefer to hit Esc to cancel a completion instead of trying to re-train myself to use Tab to confirm a selection from a dropdown menu. Either that, or I would simply switch to Tab-based completion that cycles thru the available items.

Seems like this would be less of an issue if the auto-complete menu would hide once you've typed the only matching item in the list.

EDIT: After more time playing with the idea, the more I like tab. I like how it unifies snippets and completions into one list. Very, very cool... and I am sure more will come to this realization in time.
Last edited by danro on Thu Jan 12, 2012 1:21 am, edited 2 times in total.
danro
 
Posts: 19
Joined: Thu May 19, 2011 5:39 am
Location: Sacramento, CA

Re: Dev Build 2162

Postby sublimator on Tue Jan 10, 2012 10:57 pm

Code: Select all
   // Controls if auto complete is shown when snippet fields are active.
   "auto_complete_with_fields": true,


yay!
It is better to remain silent and be thought a fool, than to speak out and remove all doubt
sublimator
 
Posts: 649
Joined: Thu Mar 20, 2008 5:41 am

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: Majestic-12 [Bot], Yahoo [Bot] and 37 guests