mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-24 17:58:51 +02:00
fix(fzf): use custom formatter for now, since filename_search messes with searching
This commit is contained in:
parent
b2b6ff0738
commit
ff223e7347
1 changed files with 34 additions and 1 deletions
|
@ -82,7 +82,8 @@ return {
|
||||||
["--no-scrollbar"] = true,
|
["--no-scrollbar"] = true,
|
||||||
},
|
},
|
||||||
defaults = {
|
defaults = {
|
||||||
formatter = "path.filename_first",
|
-- formatter = "path.filename_first",
|
||||||
|
formatter = "path.hl",
|
||||||
},
|
},
|
||||||
-- Custom LazyVim option to configure vim.ui.select
|
-- Custom LazyVim option to configure vim.ui.select
|
||||||
ui_select = function(fzf_opts, items)
|
ui_select = function(fzf_opts, items)
|
||||||
|
@ -101,6 +102,38 @@ return {
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
formatters = {
|
||||||
|
path = {
|
||||||
|
hl = {
|
||||||
|
_to = function()
|
||||||
|
local utils = require("fzf-lua.utils")
|
||||||
|
local _, hl_file = utils.ansi_from_hl("FzfLuaFilePart", "foo")
|
||||||
|
local _, hl_dir = utils.ansi_from_hl("FzfLuaDirPart", "foo")
|
||||||
|
return ([[
|
||||||
|
return function(s, _, m)
|
||||||
|
local _path, _utils = m.path, m.utils
|
||||||
|
local _hl_dir = "%s"
|
||||||
|
local _hl_file = "%s"
|
||||||
|
local parent = _path.parent(s)
|
||||||
|
local tail = _path.tail(s)
|
||||||
|
if #_hl_file > 0 then
|
||||||
|
tail = _hl_file .. tail .. _utils.ansi_escseq.clear
|
||||||
|
end
|
||||||
|
if parent then
|
||||||
|
parent = _path.remove_trailing(parent) .. "/"
|
||||||
|
if #_hl_dir > 0 then
|
||||||
|
parent = _hl_dir .. parent .. _utils.ansi_escseq.clear
|
||||||
|
end
|
||||||
|
else
|
||||||
|
parent = ""
|
||||||
|
end
|
||||||
|
return parent .. tail
|
||||||
|
end
|
||||||
|
]]):format(hl_dir, hl_file)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
winopts = {
|
winopts = {
|
||||||
width = 0.8,
|
width = 0.8,
|
||||||
height = 0.8,
|
height = 0.8,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue