rbong / vim-flog

A blazingly fast, stunningly beautiful, exceptionally powerful git branch viewer for Vim/Neovim.
750 stars 22 forks source link

Empty graph on Windows #107

Closed mhoogendoorn closed 1 year ago

mhoogendoorn commented 1 year ago

Hello there,

I upgraded to Flog v2, but on Windows I get an empty graph.

This appears to be caused by the escaping done in flog#shell#Escape(). Specifically the argument built in flog#floggraph#git#BuildLogFormat() is problematic (but the problem may present with other options, I am just using the defaults).

Is there a reason you escape a set of characters manually instead of using shellescape()? I replaced the escape() call like below and I see the expected graph on Windows, and everything still appears to work on linux. The tests still pass on my linux system (vim 9.0.1503, neovim 0.9.0).

--- a/autoload/flog/shell.vim
+++ b/autoload/flog/shell.vim
@@ -7,7 +7,7 @@ function! flog#shell#Escape(str) abort
   if a:str ==# '-'
     return a:str
   endif
-  return escape(a:str, ' *?[]{}`$\%#"|!<();&>' . "\n\t'")
+  return shellescape(a:str)
 endfunction
rbong commented 1 year ago

Is there a reason

Completion hijinx and probably other stuff I'm forgetting.

I pushed an update to use shellescape on windows or if you set g:flog_use_builtin_shellescape to true.