ncm2 / ncm2-tagprefix

tags completion for ncm2. this soruce supports prefix match only.
MIT License
1 stars 1 forks source link

Option to remove file path from the tag autocompletion #2

Closed kristijanhusak closed 6 years ago

kristijanhusak commented 6 years ago

Hi,

is there a way to remove the file path of the autocompleted tag? If not, can it be added somehow? It can give some falsy results, and it extends the width of the autocompletion a lot, without any real purpose. Here's example screenshot:

screenshot

It shows that it comes from tests, because there are multiple definitions of TaxRepository in the tags, and the tests one is the last.

roxma commented 6 years ago

Current implementation respect the :tagfiles() results.

func! ncm2_tagprefix#on_complete(ctx)
    call g:ncm2_tagprefix#proc.try_notify('on_complete', a:ctx, getcwd(), tagfiles())
endfunc

You should probably configure the :help 'tags' option.

kristijanhusak commented 6 years ago

I'm not exactly sure what can i do with the tags here? You mean set up the sorting so i get the proper file path, or there's way to hide file path? I don't see anything in help for that.

roxma commented 6 years ago

Maybe I have misunderstood your description.

Do you mean you want to show the TaxRepository in the popup menu only?

kristijanhusak commented 6 years ago

Yes, i want to see only TaxRepository [#].

roxma commented 6 years ago

You could write a filter to empty the menu field of the matches

A filter implementation example: https://github.com/ncm2/ncm2/blob/master/pythonx/ncm2_filter/same_word.py

Place the file into the {rtp}/pythonx/ncm2_filter/ directory, the change the ncm2-tagprefix config to apply the filter:

let g:ncm2_tagprefix#source = {'filter': "no_menu"}

kristijanhusak commented 6 years ago

Ok, thanks!