From c9cab43d62919c5fd34ebe33270a227a11442e12 Mon Sep 17 00:00:00 2001 From: glacambre Date: Mon, 2 Jan 2023 20:13:30 +0100 Subject: [PATCH] Use wslpath command line tool when computing windows paths on WSL Closes https://github.com/glacambre/firenvim/issues/1481 --- autoload/firenvim.vim | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/autoload/firenvim.vim b/autoload/firenvim.vim index bd37cfd3..240e1d37 100644 --- a/autoload/firenvim.vim +++ b/autoload/firenvim.vim @@ -83,6 +83,13 @@ function! s:to_wsl_path(path) abort if a:path[0] ==# '/' return a:path endif + if executable('wslpath') + try + " 0:-2 because we need to remove the \r\n + return system(['wslpath', '-a', '-u', a:path])[0:-2] + catch + endtry + endif let l:path_components = split(a:path, '\\') return join(['/mnt', tolower(path_components[0][0:-2])] + l:path_components[1:-1], '/') endfunction