justinmk / vim-dirvish

Directory viewer for Vim :zap:
Other
1.19k stars 64 forks source link

exists("#User#Fugitive") returns 1 even if vim-fugitive is not installed. #108

Closed therealcisse closed 6 years ago

therealcisse commented 6 years ago

I don't have vim-fugitive but vim-dirvish keeps showing Unknown function: fugitive#detect error.

Turns out (for me at least), exists("#User#Fugitive") always returns 1.

I propose using exists("*fugitive#detect").

I will send you a PR.

justinmk commented 6 years ago

Turns out (for me at least), exists("#User#Fugitive") always returns 1.

#User#Fugitive was chosen to future-proof if/when fugitive moves to an autoloaded model (in which case, exists("*fugitive#detect") would return false on startup, etc.).

I realize now that #User#Fugitive is a bad choice because other non-fugitive plugins may define it in order to integrate with fugitive (which is probably what happened in your case).

Can you try exists('#fugitive') ?