sodapopcan / vim-twiggy

Git branch management for Vim
280 stars 15 forks source link

Completion of branch throws error #18

Closed niklaas closed 5 years ago

niklaas commented 5 years ago

When typing

:Twiggy some-bran

and pressing Tab to complete to some-branch, the following error message is displayed:

Error detected while processing function <SNR>59_complete_branches[2]..twiggy#get_branches[1]..<SNR>213__git_branch_vv[3]..<SNR>213_parse_branch:                       
line    7:                                                                                                                                                              
E121: Undefined variable: t:twiggy_git_mode                                                                                                                             
E15: Invalid expression: t:twiggy_git_mode !=# 'normal' ? s:icons.unmerged : s:icons.current                                                                            
Error detected while processing function <SNR>59_complete_branches:                                                                                                     
line    2:                                                                                                                                                              
E714: List required

I had a quick look at the code. Probably another check for t:twiggy_git_mode is missing before https://github.com/sodapopcan/vim-twiggy/blob/d8fe9ae5b6746c94731939326e11567465719800/autoload/twiggy.vim#L189 .

sodapopcan commented 5 years ago

Thanks so much for the report—shows how often I actually use completion :)

I've put in a hack fix. I feel like I need to do some at least light refactoring here, but things should work for now.

niklaas commented 5 years ago

At work we use some weird naming convention for branches. If it would be forced upon you, you'd rely on completion heavily, I can tell you. :-) Thanks a lot for fixing this so quickly! Works perfectly for me now.

sodapopcan commented 5 years ago

No prob! I know allllll about awful branch-naming conventions.