jremmen / vim-ripgrep

Use RipGrep in Vim and display results in a quickfix list
MIT License
543 stars 99 forks source link

rg_derive_root on Windows #3

Open fraxen opened 7 years ago

fraxen commented 7 years ago

There is a problem with the derivation of RgRootDir() in Windows.

In RgMakePath - the top (root) directory is drive:/, e.g. c:/. I did a dirty little fix and changed RgMakePath to:

fun! s:RgMakePath(dirs, dir)
  let l:root = has("win32") ? '' : '/'
  return l:root.join(a:dirs[0:index(a:dirs, a:dir)], '/')
endfun

...but this doesn't work for UNC paths, e.g. //computer/share/folder, so there is room for a better solution.

jremmen commented 7 years ago

Thanks, I'll look into it when I get some time.

n00bmind commented 5 years ago

Same issue here.. @fraxen solution worked as long as I have 'shellslash' set. Otherwise we need to account for the slashes in RgRootDir() too.