Apply --scheme=path where appropriate

See https://github.com/junegunn/fzf/pull/4192
This commit is contained in:
Junegunn Choi
2025-01-30 00:26:53 +09:00
parent 80d1cc2e68
commit b3a49d7993

View File

@@ -455,7 +455,7 @@ function! fzf#vim#files(dir, ...)
let dir = s:shortpath() let dir = s:shortpath()
endif endif
let args.options = ['-m', '--prompt', strwidth(dir) < &columns / 2 - 20 ? dir : '> '] let args.options = ['--scheme', 'path', '-m', '--prompt', strwidth(dir) < &columns / 2 - 20 ? dir : '> ']
call s:merge_opts(args, s:conf('files_options', [])) call s:merge_opts(args, s:conf('files_options', []))
return s:fzf('files', args, a:000) return s:fzf('files', args, a:000)
endfunction endfunction
@@ -748,7 +748,7 @@ function! fzf#vim#gitfiles(args, ...)
return s:fzf('gfiles', { return s:fzf('gfiles', {
\ 'source': source, \ 'source': source,
\ 'dir': root, \ 'dir': root,
\ 'options': '-m --read0 --prompt "GitFiles> "' \ 'options': '--scheme path -m --read0 --prompt "GitFiles> "'
\}, a:000) \}, a:000)
endif endif
@@ -766,7 +766,7 @@ function! fzf#vim#gitfiles(args, ...)
let wrapped = fzf#wrap({ let wrapped = fzf#wrap({
\ 'source': prefix . '-c color.status=always status --short --untracked-files=all', \ 'source': prefix . '-c color.status=always status --short --untracked-files=all',
\ 'dir': root, \ 'dir': root,
\ 'options': ['--ansi', '--multi', '--nth', '2..,..', '--tiebreak=index', '--prompt', 'GitFiles?> ', '--preview', preview] \ 'options': ['--scheme', 'path', '--ansi', '--multi', '--nth', '2..,..', '--tiebreak=index', '--prompt', 'GitFiles?> ', '--preview', preview]
\}) \})
call s:remove_layout(wrapped) call s:remove_layout(wrapped)
let wrapped.common_sink = remove(wrapped, 'sink*') let wrapped.common_sink = remove(wrapped, 'sink*')