Sublime Forum

TAB occasionally dismisses autocomplete window

#1

Hi there,

I have an intermittent issue (happens maybe 10% of the time) where type TAB will dismiss the autocomplete popup dialog, rather than inserting the selecting autocompletion text.

I’ve found one reproducible case, although I’m not sure if the issue is limited to this:

  1. I use the GoSublime package, which uses some type-based code intelligence to help autofill method and member identifiers.

  2. Sometimes, the autocompletion of a method identifier will include a default argument identifier, e.g. “goquery.NewDocument(url)”

  3. After I’ve pressed TAB to autofill the method and default argument “NewDocument(url)”, the argument identifier “url” will be selected automatically.

  4. I start typing text to replace the autofilled default argument, and an autocomplete popup appears.

  5. I select the identifier I want and press TAB, but instead of autocompleting, it just advances the cursor past the selected text, leaving the argument as whatever I typed to initiate the autocompletion of the argument identifier.

Any ideas if this is a settings issue?

EDIT: For what it’s worth, I swear I’ve had this happen while editing Ruby code (not necessarily with method args), so I’m not sure if it’s an issue with the GoSublime package.

Here’s more info on my setup;

Sublime Text 2 with the following packages:

  • Git
  • GoSublime
  • PackageControl
  • Rust
  • SML (Standard ML)
  • TrailingSpaces

And my settings file:

{
	"find_selected_text": true,
	"ignored_packages":
	
		"Vintage"
	],
	"tab_size": 2,
	"trailing_spaces_include_current_line": false,
	"trailing_spaces_modified_lines_only": true,
	"trailing_spaces_trim_on_save": true
}

Thanks in advance!

0 Likes

#2

I think you inside a snippets (thats why you have some part already preselected): when inside a snippet, the tab is used to navigate to different part of the snippets (in your example first position is the argument, second position is the end).
When you are inside a snippets you should use enter instead of tab to select the result of the autocompletion.

0 Likes

#3

Yeah you should be able to just CMD/CTRL + Z back to the spot and kill snippet tab

0 Likes