This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 251037 - option so <TAB> does not exit/finish completion, only does common prefix
Summary: option so <TAB> does not exit/finish completion, only does common prefix
Alias: None
Product: editor
Classification: Unclassified
Component: Completion & Templates (show other bugs)
Version: 8.0.2
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Dusan Balek
Depends on:
Reported: 2015-03-09 15:20 UTC by err
Modified: 2015-04-01 13:32 UTC (History)
0 users

See Also:
Exception Reporter:

possible (1.26 KB, patch)
2015-03-09 19:58 UTC, err
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description err 2015-03-09 15:20:27 UTC
It's been a while since I've done a lot of work with NB.  I find I've been 
doing a lot more typing (doing undo and backspace) because of what tab does 
during completion.  The change for Bug 208223 messed things up for me.

The current setup requires a very conscious scan of the completion list in
order to determine what TAB will do; this extra work diminishes the usefulness 
of common prefix completion. I'd prefer to hit tab and know that my next
character input will refine my choices. Now I have to examine the list 
carefully, and then make my editing choice. In addition, since <ENTER> is 
easily available, there's little advantage to using <TAB>.

So if alternate behavior is wanted, an option seems appropriate so it doesn't 
mess with the smooth and interactive feedback feel of tab used only for prefix.
If the completion list only had one element, OK with tab finishing seems OK.

(BTW, I think the change for Bug 208223 is like dumbing down the editor so
that it behaves like IDEA. ;-) )

Example use cases:

    - enter
    observe list of several exceptions
    - enter
    observe filling in common prefix

    - note: if <tab> entered again at this point completion finishes
      It could be argued that since the highlighted item shares a common
      prefix that prefix should be completed. Better to do nothing.

    - Consider this one, enter
    observe about 6 items,
    - enter
    observe the list goes down to three items. In this case I want one of the
    illegalaccess choices so I
    - enter
    and it completes, even though the highlighted item has a long common
    prefix with the next item. I made a mistake. (I should have entered
    "ac<tab>".)  If after just "a<tab>" nothing had happened it's easy to
    continue; I just enter the "C<tab>", but it's not so easy if it completes.

If there is an issue about the UI, I'd be happy with a system property 
-DCompletionTabOnlyForPrefix or somesuch that I can set during startup
while the UX people sort things out.
Comment 1 err 2015-03-09 19:58:15 UTC
Created attachment 152511 [details]

Attached a patch that shows proof of concept. It only executes the change from Bug 208223 when Boolean.getBoolean("editor.completion.TabOnlyForPrefix") is false. If the system property is true then you get the original behavior.

I made no attempt to understand the surrounding code; it seems to work.

It's a proof of concept. I suppose it could be used as is, but caching the value of Boolean.getBoolean("editor.completion.TabOnlyForPrefix") might be good.
Comment 2 Dusan Balek 2015-03-10 14:06:55 UTC
'org.netbeans.modules.editor.completion.noTabCompletion' option added.
Comment 3 Quality Engineering 2015-03-13 03:13:56 UTC
Integrated into 'main-silver', will be available in build *201503130001* on (upload may still be in progress)

User: Dusan Balek <>
Log: Issue #251037: option so <TAB> does not exit/finish completion, only does common prefix - fixed.