Sublime Forum

Questions about tab completion

#1

I’ve some issues with the new tab completion system.
When the right word/snippet is inserted it’s great, but what to do when it’s not the case ?

Actually I:

  1. type the part of a word
  2. Insert Best Completion (tab)
    !Wrong action/word
  3. undo the Insert Best Completion (ctrl+z)
  4. open the completion lookup (ctrl+space)
  5. select the right item.

As the selected item is remembered, next time it work great except for word that are similar:
‘wh’ for when, what, while, where, …

My questions are:

  1. Is there a quicker way to correct a wrong completion ?
  2. For case when best completion could not find an item with enough confidence, isn’t it better to show the lookup ?
  3. Is code completion now case sensitive ?
    ex:

procedure TwxServerThread.Home; begin end;
‘twx’ tab or ctrl+space doesn’t return anything.

On Build 2032 Win7 64

0 Likes

#2

this is a great question, I’m wondering too!

0 Likes

#3

With tab_completion on, pressing Tab will always cause Sublime to make a decision for you and insert the “best” match (in case of several matches with the same prefix, I think the final selection is done by alphabetical order). The behavior of tab_completion is explained here:

sublimetext.info/docs/extensibil … tions.html

Conversely, Ctrl+spacebar will never make a decision for you when faced with ambiguity; it will show the autocomplete list instead so you can pick an suggestion.

It seems so, yeah.

0 Likes

#4

I wonder why, when in scope of both HTML and PHP, a>tab triggers: abs() (trigger:abs) and not (trigger: a). And why pressing one or two keys triggers functions like cairo_ps_surface_dsc_begin_page_setup() (trigger: cairo_ps_surface_dsc_begin_page_setup) instead of much simpler HTML tags. It is “best” at best.

0 Likes

#5

That’s a good question… Probably due to scope selectors in snippets, but I don’t really know how that works or if it influences the sort order for completions (rather than just snippet filtering before extracting completions).

0 Likes

#6

It doesn’t. Within a PHP block <?php ... ?>, a,tab will insert abs, and outside of such a block, a,tab will insert an .

0 Likes