Skip to content

Bug: path_shorten breaks previewers in combine() #2517

@jyn514

Description

@jyn514

RTFM Checklist

  • I have searched exisiting issues / discussions
  • I have read the Wiki including the Advanced section
  • I have read man fzf / I am well versed in shell fzf

Operating system

macOS Sequoia 15.7.3

Shell

fish

Neovim version (nvim --version)

NVIM v0.11.5

Fzf version (fzf --version)

0.67.0 (Homebrew)

Output of :lua print(os.getenv('FZF_DEFAULT_OPTS'))

--cycle --exit-0 --select-1 --preview-window=wrap

Is the problem reproducible with mini.sh?

  • My issue is reproducible with mini.sh
  • My issue IS NOT reproducible with mini.sh
  • I have not tested with mini.sh (not relevant, requires LSP, Windows, etc)

Fzf-lua configuration

local pickers = require('fzf-lua')
pickers.setup({
	files = {
		path_shorten = true,
        }
})
vim.keymap.set('n', ',f', function()
	pickers.combine({ pickers = "git_files;files" })
end, { desc = "Open file picker" })

Describe the bug / steps to reproduce

  1. Press ,f to open the file picker.
  2. See entries like the following:
Image

This only happens when the git_files picker comes first; if it comes second everything works fine.

I think the problem here is this bit from the readme:

The first picker options determine the options used by the combined picker, that includes formatters, previewer, path_shorten, etc. To avoid errors combine only pickers of the same entry types (i.e files)

Probably the git picker doesn't support all the same options as the file backend? Maybe it's possible to add them?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions