Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions lua/telescope/make_entry.lua
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ do
local cwd = utils.path_expand(opts.cwd or vim.loop.cwd())

local disable_devicons = opts.disable_devicons
local icon_separator = opts.icon_separator

local mt_file_entry = {}

Expand All @@ -160,7 +161,7 @@ do
local hl_group, icon
local display, path_style = utils.transform_path(opts, entry.value)

display, hl_group, icon = utils.transform_devicons(entry.value, display, disable_devicons)
display, hl_group, icon = utils.transform_devicons(entry.value, display, disable_devicons, icon_separator)

if hl_group then
local style = { { { 0, #icon + 1 }, hl_group } }
Expand Down Expand Up @@ -273,6 +274,7 @@ do
end

local disable_devicons = opts.disable_devicons
local icon_separator = opts.icon_separator
local disable_coordinates = opts.disable_coordinates
local only_sort_text = opts.only_sort_text

Expand Down Expand Up @@ -331,7 +333,8 @@ do
local display, hl_group, icon = utils.transform_devicons(
entry.filename,
string.format(display_string, display_filename, coordinates, entry.text),
disable_devicons
disable_devicons,
icon_separator
)

if hl_group then
Expand Down Expand Up @@ -585,6 +588,7 @@ function make_entry.gen_from_buffer(opts)
opts = opts or {}

local disable_devicons = opts.disable_devicons
local icon_separator = opts.icon_separator or ""

local icon_width = 0
if not disable_devicons then
Expand All @@ -598,6 +602,7 @@ function make_entry.gen_from_buffer(opts)
{ width = opts.bufnr_width },
{ width = 4 },
{ width = icon_width },
{ width = #icon_separator },
{ remaining = true },
},
}
Expand All @@ -614,6 +619,7 @@ function make_entry.gen_from_buffer(opts)
{ entry.bufnr, "TelescopeResultsNumber" },
{ entry.indicator, "TelescopeResultsComment" },
{ icon, hl_group },
{ icon_separator },
{
display_bufname .. ":" .. entry.lnum,
function()
Expand Down
6 changes: 4 additions & 2 deletions lua/telescope/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,9 @@ utils.transform_devicons = load_once(function()
devicons.setup()
end

return function(filename, display, disable_devicons)
return function(filename, display, disable_devicons, icon_separator)
icon_separator = icon_separator or " "

local conf = require("telescope.config").values
if disable_devicons or not filename then
return display
Expand All @@ -625,7 +627,7 @@ utils.transform_devicons = load_once(function()
icon, icon_highlight = devicons.get_icon(basename, nil, { default = true })
icon = icon or " "
end
local icon_display = icon .. " " .. (display or "")
local icon_display = icon .. icon_separator .. (display or "")

if conf.color_devicons then
return icon_display, icon_highlight, icon
Expand Down