Skip to content

Commit 3b862da

Browse files
committed
fix(buffers|tabs): git_icons=true (closes #2232)
1 parent a63d01d commit 3b862da

2 files changed

Lines changed: 4 additions & 12 deletions

File tree

lua/fzf-lua/defaults.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,7 @@ M.defaults.loclist_stack = {
709709
}
710710

711711
M.defaults.buffers = {
712+
_type = "file",
712713
previewer = M._default_previewer_fn,
713714
file_icons = 1,
714715
color_icons = true,
@@ -731,6 +732,7 @@ M.defaults.buffers = {
731732
}
732733

733734
M.defaults.tabs = {
735+
_type = "file",
734736
previewer = M._default_previewer_fn,
735737
tab_title = "Tab",
736738
tab_marker = "<<",

lua/fzf-lua/providers/buffers.lua

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,8 @@ local function gen_buffer_entry(opts, buf, max_bufnr, cwd, prefix)
146146
return path.tail(bname)
147147
else
148148
bname = make_entry.lcol({ filename = bname, lnum = buf.info.lnum }, opts):gsub(":$", "")
149-
return make_entry.file(bname, vim.tbl_extend("force", opts,
150-
-- No support for git_icons, file_icons are added later
151-
{ cwd = cwd or opts.cwd or uv.cwd(), file_icons = false, git_icons = false }))
149+
return make_entry.file(bname,
150+
vim.tbl_extend("force", opts, { cwd = cwd or opts.cwd or uv.cwd() }))
152151
end
153152
end)()
154153
if buf.flag == "%" then
@@ -161,15 +160,6 @@ local function gen_buffer_entry(opts, buf, max_bufnr, cwd, prefix)
161160
local bufnrstr = string.format("%s%s%s", leftbr,
162161
utils.ansi_codes[opts.hls.buf_nr](tostring(buf.bufnr)), rightbr)
163162
local buficon = ""
164-
local hl = ""
165-
if opts.file_icons then
166-
buficon, hl = devicons.get_devicon(buf.info.name,
167-
-- shell-like icon for terminal buffers
168-
utils.is_term_bufname(buf.info.name) and "sh" or nil)
169-
if hl and opts.color_icons then
170-
buficon = utils.ansi_from_rgb(hl, buficon)
171-
end
172-
end
173163
local max_bufnr_w = 3 + #tostring(max_bufnr) + utils.ansi_escseq_len(bufnrstr)
174164
local item_str = string.format("%s%s%s%s%s%s%s%s",
175165
prefix or "",

0 commit comments

Comments
 (0)