From 124cd70710cb7c94ef2282773494bb0d727598d8 Mon Sep 17 00:00:00 2001 From: Konstantin-Glukhov <24302271+Konstantin-Glukhov@users.noreply.github.com> Date: Tue, 28 May 2024 23:15:14 +0900 Subject: [PATCH] [vim] Do not prepend CWD to path starting with a backslash on Windows (#3820) Co-authored-by: Junegunn Choi --- plugin/fzf.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/fzf.vim b/plugin/fzf.vim index fc7b196..3a8765b 100644 --- a/plugin/fzf.vim +++ b/plugin/fzf.vim @@ -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