Sublime Forum

Autocomplete: how to show only the text?

#1

Hi,
I’m using the All Autocomplete plugin on txt files. I wish the popup window would only show the words, without the source file names, which are only disruptive in my case (it slows me down). Is it possible to modify the autocomplete settings to display only the words?

1 Like

#2

The All Autocomplete package does not show file names, unless they are found inside the file, as contents.

In that case, there is no setting to change this behavior. You need to edit the package to change that behavior.

Along the package code, you can add something like this line:

                    if re.match( r'.+\..+', word): continue

This will skip the words which match the regular expression .+\..+ which was an approximation I just made up to match file names.

0 Likes

#3

I think you may be referring to this file name:

On that case, you need to edit the plugin code and remove these two lines:

            if v.id != view.id and v.file_name():
                trigger += '\t(%s)' % basename(v.file_name())

Please, try including screenshots while presenting your problem.

0 Likes

#4

Hi addons_zz,

Yes, thank you, this is what I’m referring to.
I would like to try your solution, but I’m not a programmer, just a translator using Sublime as a text editor (txt files)… so I’m completely lost. Where is the plugin file? (I found the package file, on my Mac, in Library - Application Support - Sublime… - Installed packages, but I cannot open it. I also looked at the help on package editing, installed Github Desktop… and then I’m lost. :cry:

1 Like

#5

The simple way to edit the plugin for you, is to install the PackageResourceViewer. Do you have Package Control installed? If yes, then, just go to the menu Preferences -> Package Control, then type, Package Control Install Package, then type PackageResourceViewer.

Once you have PackageResourceViewer installed, you just need to go to Tools -> Command Palette, then type PackageResourceViewer Open Resource, then type AllAutocomplete, then type all_views_completions.

This will open the plugin file you need to edit. After opening it, find these two lines I mentioned, and delete them both. Once you complete that, you can save and close the file.

1 Like

#6

Thank you addons_zz, it solved the problem!

1 Like