NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
TAB not same as ENTER in autocomplete in 4.6.3


Joined: 30 Jan 2007
Posts: 34
Reply with quote
I just upgraded 4.6.2 to 4.6.3 today. I have found this problem with TAB when using auto-completion/code-insight.

It will not auto-complete for you when you hit TAB unless the item in the box is the only one there. The ENTER key still auto-completes as it used to.

Code:
<?php
   $thing1 = 1;
   $thing2 = 2;

   // try typing "$thi" here and see how TAB will not finish the line for you
?>
View user's profileFind all posts by rgagnonSend private message
Veteran

Joined: 24 Jan 2006
Posts: 311
Reply with quote
I am sorry, I know I am missing the point - why would TAB key complete the line Smile?
View user's profileFind all posts by yfaktorSend private message


Joined: 30 Jan 2007
Posts: 34
Reply with quote
Because according to the 4633 email, TAB is now a completion character for code-insight along with the pre-existing use of the ENTER key.

Or, more specifically:

Code insight will show you both $thing1 and $thing2 as options. You can select either one with the cursor up/down keys, but TAB will not complete either of them. Only ENTER does that.

BUT: If code insight only found 1 match (instead of the 2 in this example), TAB would complete it.
View user's profileFind all posts by rgagnonSend private message
Veteran

Joined: 24 Jan 2006
Posts: 311
Reply with quote
I see now, thank you. Actually it is working as designed, tab only completes the line if there is only one entry on the list
View user's profileFind all posts by yfaktorSend private message


Joined: 30 Jan 2007
Posts: 34
Reply with quote
Sorry to say, but that's not very helpful.

I don't know about the reasons behind that design, but the release notes in the 4.6.3 news made it sound as though the TAB key worked just like the ENTER key for code completion. That would have been useful.

What's the use of having TAB complete the line when only 1 item remains in the list? If it takes a lot of typing to make the list only have one entry, you have defeated the purpose of using the cursor key to find what you want.

As in the example above, I would have to type $thing1 or $thing2 to make the variables unique. Now the need for code completion is moot, as I already typed the whole variable name myself.
View user's profileFind all posts by rgagnonSend private message


Joined: 28 Jun 2006
Posts: 92
Reply with quote
agreed.. TAB should operate exactly as ENTER in a multiple select autocomplete.
View user's profileFind all posts by bcswebstudioSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8351
Reply with quote
Initial request was to have TAB operating the way we implemented it, e.g. when only one item remains in the dropdown.
Personally, I see no advantages to have TAB operating equally to ENTER.
What if we think about a different approach?
Just for example, let me explain how TAB works in SHELL (it's all for Windows adicts because all unix guys know it well, I think)
Let's adapt scenario to php:
For example you may have just two letters in php area: "my" and invoke code completion using TAB. It will add mysql immediately upon tab is pressed. No dropdown is shown because all the items in the code completion list filtered by "my" start with mysql (including all mysql_xxx functions, mysql and mysqli_xxx functions) - it's the leftmost common sequence, so you have no other choises but mysql, so it's added without dropdown. Then you proceed with specifying what you need after mysql by typing for example _cl, in this case you have quite tiny list of functions: mysql_client_encoding and mysql_close. If you press TAB now, you'll see the list because at least one item in this list has different letters after _cl (otherwide it would add all common letters without showing dropdown).

Any thoughts if this would be more usable than Enter?

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 28 Jun 2006
Posts: 92
Reply with quote
Thanks for opening the floor for a discussion.

I love your idea of auto-completing as much as matches exactly when TAB is hit like seen in sh, but ONLY IF the following is kept: The drop down should still show and should autofilter as you complete more text as normal. This would very effectively eliminate the need for arrowing up/down in the dropdown, but the option would still be there to do so. In fact, this would be even more effective in that it could let you write obnoxious variable lists like:

$email_var1
$email_var2
$email_var3
$email_var4
...

by first typing out "$email_var1"
then you type out "$em[TAB]" and magically, "$email_var1" would appear with TAB, you backspace one, hit "2"
then you type out "$em[TAB]3", "$em[TAB]4" ad infinitum.

Great idea, Dmitri. But please please keep the drop-down list of candidate completion as well.
View user's profileFind all posts by bcswebstudioSend private message


Joined: 30 Jan 2007
Posts: 34
Reply with quote
dmitri wrote:
...you may have just two letters in php area: "my" and invoke code completion using TAB. It will add mysql immediately upon tab is pressed...


OK this explanation makes some sense for TAB completion operating in a different manner than I expected. I understand what you were aiming at. Now however, that isn't what happens for me.

Is there a setting to enable that?

If I type "my{TAB}" I get "my" and a TAB. It does not type "sql" after the "my"
View user's profileFind all posts by rgagnonSend private message


Joined: 28 Jun 2006
Posts: 92
Reply with quote
right-- he has recognized your issue post and, in addressing it, he is proposing an additional behavior (in addition to our original desire to have TAB act exactly as ENTER as we were hoping).

Try to weed through my previous reply to dmitri-- I think this is a behavior that would satisfy both our original request and add new functionality.

Hmm.. On second visit there is a problem here-- TAB cannot act as both ENTER and "mostly-complete" in conjunction with a dropdown, would it? . . If this is the case, and if it can't be resolved, I believe I would prefer to see the originally requested behavior, namely that TAB acts exactly as ENTER.
View user's profileFind all posts by bcswebstudioSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8351
Reply with quote
Quote:
TAB cannot act as both ENTER and "mostly-complete" in conjunction with a dropdown, would it?

Why? Do you expect any problems?

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 28 Jun 2006
Posts: 92
Reply with quote
It dawned on me that when you type and a list of autocomplete candidate items appears, the first item will already be selected. If you hit TAB (and hoping here that TAB can still act == ENTER), then the first item on the list (not the first partial match as you had suggested in your prev. post) would be selected.

TAB would necessarily have to behave differently from ENTER and could not be a hybrid sh-style and ENTER-select-style combo. It is solvable by making clear option in the pref's: TAB acts as ENTER in auto-complete or TAB acts as sh-style partial complete (or something)...
View user's profileFind all posts by bcswebstudioSend private message
TAB not same as ENTER in autocomplete in 4.6.3
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 2  

  
  
 Reply to topic