Home Download Buy Blog Forum Support

How to cancel autocompletion?

How to cancel autocompletion?

Postby mcbsys on Fri May 25, 2012 11:42 pm

Many times, Sublime offers me an autocompletion list that does not include the option I want. My intuition when I want to cancel an action is to press Escape, but when I press Escape in Sublime, it commits the highlighted autocomplete.

For example, if I'm typing a locale files in Rails, I might want to translate "cancel" as "Cancel":

en:
cancel: Cancel

If I'm not very careful, Sublime, will autocomplete the second word as "cancel", i.e. the case is wrong.

I want the autocomplete to work on Enter (at least if I have moved the cursor to select an autocomplete item), so "auto_complete_commit_on_tab": true doesn't help.

How do I cancel the autocomplete and close the list of choices? Can that be done on Escape?

Thanks,

Mark
mcbsys
 
Posts: 5
Joined: Fri May 25, 2012 11:16 pm

Re: How to cancel autocompletion?

Postby C0D312 on Sat May 26, 2012 12:16 am

hmmm... Escape should cancel the autocompletion. Do you have any plugins installed? I seem to recall that the plugin sublime_text_alternative_autocompletion uses escape to cycle through autocompletions.

An easy way to tell what's going on is by opening the console (control + `) and typing the following:
Code: Select all
sublime.log_commands(True)
Then type something that will trigger the autocomplete. When you press escape to cancel, check what appears in the console. It should say something like
Code: Select all
command: hide_auto_complete
Let me know if it says something different.
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Re: How to cancel autocompletion?

Postby mcbsys on Sat May 26, 2012 1:07 am

Interesting...if the console is open, the autocomplete DOES cancel on Escape.

So yeah, I found Sublime from Michael Hartl's Rails Tutorial and blindly followed his setup recommendations. it turns out this behavior is coming from alternative_autocomplete. (Apparently autocompletion on Escape is a Mac thing.)

I'll try the plugin's alternative alternative, mapping the Tab key in Default (Linux).sublime-keymap.

Thanks for the quick help,

Mark

P.S. Meta question: how do I subscribe to this forum topic? I can't find a "Subscribe" or "Watch" link.
mcbsys
 
Posts: 5
Joined: Fri May 25, 2012 11:16 pm

Re: How to cancel autocompletion?

Postby C0D312 on Sat May 26, 2012 1:29 am

Meta question: how do I subscribe to this forum topic? I can't find a "Subscribe" or "Watch" link.

Sorry, not possible.
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Re: How to cancel autocompletion?

Postby scruffydan on Wed May 30, 2012 10:33 pm

You might want to set:

"auto_complete_commit_on_tab": true

In your User - Preferences...

That way you only commit on TAB.
scruffydan
 
Posts: 6
Joined: Tue May 29, 2012 2:56 am


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot] and 26 guests