sodapopcan / vim-twiggy

Git branch management for Vim
280 stars 15 forks source link

Fix completion #6

Closed aschrab closed 6 years ago

aschrab commented 6 years ago

A couple of small changes to have branch names completed for the :Twiggy command.

sodapopcan commented 6 years ago

Wow, shows how much I use this feature! Thanks for catching this and, yes, completion is much nicer this way.

I know it's a contentious issue but I absolutely can't stand when plugins expose random functions like you did with the complete function--I do realize it's public as it is, but the completion was one of the first things I did while I was still learning viml and I never changed it. I would actually much prefer you move the completion function to the plugin file, make it a script variable and expose the get_branches() function which could be a really useful public function.

What do you think? If it were to stay as is, it should at the very least be renamed to twiggy#complete_git_branches(). How it is is a bit redundant.

Thanks again for catching this!

aschrab commented 6 years ago

I generally find it difficult to decide between exposing that type of function which can be done in an autoload file, or keeping it private but needing to have that done during vim startup. So, my original choice here was to avoid moving it from where it was originally declared.

But since it is quite small I think I agree that it would be better to keep it private, so I've made the necessary adjustments to do so.

sodapopcan commented 6 years ago

Thanks!