Home Download Buy Blog Forum Support

Disabling content words in autocompletion pop-up. [resolved]

Disabling content words in autocompletion pop-up. [resolved]

Postby mikebaza on Fri Aug 16, 2013 8:21 pm

Hi.

Screen of the problem:
http://mikebaza.com/image.png

Description:
I created a file named 'Test' with two words 'Test' and 'TestTest' and it seems that these words are being automatically added to autocompletion pop-ups. Which i don't want to be done.

How can i resolve this issue?
Last edited by mikebaza on Sat Aug 17, 2013 11:21 am, edited 1 time in total.
mikebaza
 
Posts: 3
Joined: Fri Aug 16, 2013 8:08 pm

Re: Disabling content words in autocompletion pop-up.

Postby skuroda on Sat Aug 17, 2013 3:53 am

That's how the built in auto complete functionality works. Since it doesn't appear you want the autocompletion, add the following to your user settings.

Code: Select all
"auto_complete": false
skuroda
 
Posts: 681
Joined: Fri Oct 05, 2012 8:11 am

Re: Disabling content words in autocompletion pop-up.

Postby mikebaza on Sat Aug 17, 2013 4:11 am

I know that commnad but i want do something other.

http://docs.sublimetext.info/en/latest/ ... tions.html
in this link you have order in which autocomplete works:

- Snippets
- API-injected completions
- .sublime-completions files
- Words in buffer

and I want exclude 'Words in buffer' from that list and leave other items. But how?
Last edited by mikebaza on Sat Aug 17, 2013 11:22 am, edited 2 times in total.
mikebaza
 
Posts: 3
Joined: Fri Aug 16, 2013 8:08 pm

Re: Disabling content words in autocompletion pop-up.

Postby skuroda on Sat Aug 17, 2013 5:28 am

I see, create a plugin with the following content. Think that should do what you want.

Code: Select all
import sublime
import sublime_plugin


class DisableCompletionListener(sublime_plugin.EventListener):
    def on_query_completions(self, view, prefix, locations):
        return ([], sublime.INHIBIT_WORD_COMPLETIONS)
skuroda
 
Posts: 681
Joined: Fri Oct 05, 2012 8:11 am

Re: Disabling content words in autocompletion pop-up.

Postby mikebaza on Sat Aug 17, 2013 11:19 am

Thank you very much Skuroda. Your code works.

For those who will have the same problem:
1. make 'step one' with 'Hello Word' from this tutorial: http://net.tutsplus.com/tutorials/pytho ... -2-plugin/
2. replace code and past skuroda's user code.
3. restart ST2

This forum is great.
mikebaza
 
Posts: 3
Joined: Fri Aug 16, 2013 8:08 pm


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 26 guests