From c491d702b76c6b4918abb80be3cfb57d1b618ffa Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Tue, 9 Aug 2022 13:47:17 +0900 Subject: [PATCH] [GFiles] Fix opening files from subdirectory https://github.com/junegunn/fzf.vim/pull/1290#issuecomment-1208759166 --- autoload/fzf/vim.vim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/autoload/fzf/vim.vim b/autoload/fzf/vim.vim index 9a641a4..7653c09 100644 --- a/autoload/fzf/vim.vim +++ b/autoload/fzf/vim.vim @@ -619,6 +619,7 @@ function! fzf#vim#gitfiles(args, ...) if a:args != '?' return s:fzf('gfiles', { \ 'source': prefix . 'ls-files '.a:args.(s:is_win ? '' : ' | uniq'), + \ 'dir': root, \ 'options': '-m --prompt "GitFiles> "' \}, a:000) endif @@ -635,6 +636,7 @@ function! fzf#vim#gitfiles(args, ...) \ s:bin.preview) let wrapped = fzf#wrap({ \ 'source': prefix . '-c color.status=always status --short --untracked-files=all', + \ 'dir': root, \ 'options': ['--ansi', '--multi', '--nth', '2..,..', '--tiebreak=index', '--prompt', 'GitFiles?> ', '--preview', preview] \}) call s:remove_layout(wrapped)