wellle / tmux-complete.vim

Vim plugin for insert mode completion of words in adjacent tmux panes
MIT License
515 stars 21 forks source link

Rename completion function and file, return results as list #22

Closed ferreum closed 10 years ago

ferreum commented 10 years ago

CompleteScript should be renamed so it is not a global function. The old name still works and just delegates everything to tmuxcomplete#complete. I think this should be deprecated. This also means the script needs to be renamed to tmuxcomplete.vim.

I also removed the call to complete_add to return the results as list. Will this break anything? It seems to work fine here.

These changes also make the plugin compatible for a NeoComplete omni-completion function.

NeoComplete configuration example (for all filetypes):

let g:neocomplete#sources#omni#functions._ = 'tmuxcomplete#complete'
let g:neocomplete#sources#omni#input_patterns['tmuxcomplete#complete'] = '\S\+'
wellle commented 10 years ago

Oh that NeoComplete part is very interesting! I will try it.

I think tmuxcomplete#complete could be moved to autoload now.

By deprecating you mean setting completefunc=tmuxcomplete#complete directly? If that works I'm totally fine with it.

Good stuff :+1:

ferreum commented 10 years ago

Yes you should use tmuxcomplette#complete directly. CompleteScript is only there to prevent breaking configurations where someone used it (maybe add a notice somewhere).

I've added another commit that moves the function to autoload and sets the correct value to completefunc.

wellle commented 10 years ago

I just removed the function in #25. I think we don't need to care about compatibility too much. :wink: