fix: icon hl width for various pickers (#2450)
This commit is contained in:
@@ -886,13 +886,16 @@ builtin.treesitter() *telescope.builtin.treesitter()*
|
|||||||
|
|
||||||
|
|
||||||
Options: ~
|
Options: ~
|
||||||
{show_line} (boolean) if true, shows the row:column that the
|
{show_line} (boolean) if true, shows the row:column that
|
||||||
result is found at (default: true)
|
the result is found at (default:
|
||||||
{bufnr} (number) specify the buffer number where
|
true)
|
||||||
treesitter should run. (default:
|
{bufnr} (number) specify the buffer number where
|
||||||
current buffer)
|
treesitter should run. (default:
|
||||||
{symbol_highlights} (table) string -> string. Matches symbol with
|
current buffer)
|
||||||
hl_group
|
{symbols} (string|table) filter results by symbol kind(s)
|
||||||
|
{ignore_symbols} (string|table) list of symbols to ignore
|
||||||
|
{symbol_highlights} (table) string -> string. Matches symbol
|
||||||
|
with hl_group
|
||||||
|
|
||||||
|
|
||||||
builtin.current_buffer_fuzzy_find({opts}) *telescope.builtin.current_buffer_fuzzy_find()*
|
builtin.current_buffer_fuzzy_find({opts}) *telescope.builtin.current_buffer_fuzzy_find()*
|
||||||
|
|||||||
@@ -157,13 +157,13 @@ do
|
|||||||
|
|
||||||
mt_file_entry.cwd = cwd
|
mt_file_entry.cwd = cwd
|
||||||
mt_file_entry.display = function(entry)
|
mt_file_entry.display = function(entry)
|
||||||
local hl_group
|
local hl_group, icon
|
||||||
local display = utils.transform_path(opts, entry.value)
|
local display = utils.transform_path(opts, entry.value)
|
||||||
|
|
||||||
display, hl_group = utils.transform_devicons(entry.value, display, disable_devicons)
|
display, hl_group, icon = utils.transform_devicons(entry.value, display, disable_devicons)
|
||||||
|
|
||||||
if hl_group then
|
if hl_group then
|
||||||
return display, { { { 1, 3 }, hl_group } }
|
return display, { { { 1, #icon }, hl_group } }
|
||||||
else
|
else
|
||||||
return display
|
return display
|
||||||
end
|
end
|
||||||
@@ -326,14 +326,14 @@ do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local display, hl_group = utils.transform_devicons(
|
local display, hl_group, icon = utils.transform_devicons(
|
||||||
entry.filename,
|
entry.filename,
|
||||||
string.format(display_string, display_filename, coordinates, entry.text),
|
string.format(display_string, display_filename, coordinates, entry.text),
|
||||||
disable_devicons
|
disable_devicons
|
||||||
)
|
)
|
||||||
|
|
||||||
if hl_group then
|
if hl_group then
|
||||||
return display, { { { 1, 3 }, hl_group } }
|
return display, { { { 1, #icon }, hl_group } }
|
||||||
else
|
else
|
||||||
return display
|
return display
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -440,13 +440,14 @@ utils.transform_devicons = load_once(function()
|
|||||||
local icon, icon_highlight = devicons.get_icon(basename, utils.file_extension(basename), { default = false })
|
local icon, icon_highlight = devicons.get_icon(basename, utils.file_extension(basename), { default = false })
|
||||||
if not icon then
|
if not icon then
|
||||||
icon, icon_highlight = devicons.get_icon(basename, nil, { default = true })
|
icon, icon_highlight = devicons.get_icon(basename, nil, { default = true })
|
||||||
|
icon = icon or " "
|
||||||
end
|
end
|
||||||
local icon_display = (icon or " ") .. " " .. (display or "")
|
local icon_display = icon .. " " .. (display or "")
|
||||||
|
|
||||||
if conf.color_devicons then
|
if conf.color_devicons then
|
||||||
return icon_display, icon_highlight
|
return icon_display, icon_highlight, icon
|
||||||
else
|
else
|
||||||
return icon_display, nil
|
return icon_display, nil, icon
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user