[vim] Do not prepend CWD to path starting with a backslash on Windows (#3820)

Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
This commit is contained in:
Konstantin-Glukhov 2024-05-28 23:15:14 +09:00 committed by GitHub
parent 99bd6de541
commit 124cd70710
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -327,7 +327,7 @@ 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 item[0] != '~' && item !~ (s:is_win ? '^[A-Z]:\' : '^/')
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)
endif