[vim] Replace backslashes with forward slashes on win32unix

This commit is contained in:
Junegunn Choi 2024-05-23 09:03:43 +09:00
parent b5b0d6b3ea
commit 561f9291fd
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

@ -327,6 +327,9 @@ function! s:common_sink(action, lines) abort
" the execution (e.g. `set autochdir` or `autocmd BufEnter * lcd ...`)
let cwd = exists('w:fzf_pushd') ? w:fzf_pushd.dir : expand('%:p:h')
for item in a:lines
if has('win32unix') && item !~ '/'
let item = substitute(item, '\', '/', 'g')
end
if item[0] != '~' && item !~ (s:is_win ? '^[A-Z]:\' : '^/')
let sep = s:is_win ? '\' : '/'
let item = join([cwd, item], cwd[len(cwd)-1] == sep ? '' : sep)