Skip to content

Commit 0fe2147

Browse files
committed
feat(path_display): support filename_first
1 parent 8574946 commit 0fe2147

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

lua/telescope/_extensions/file_browser/make_entry.lua

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,13 @@ local make_entry = function(opts)
125125
local display_array = {}
126126
local icon, icon_hl
127127

128-
local tail = fb_utils.sanitize_path_str(entry.ordinal)
129-
local path_display = utils.transform_path(opts, tail)
128+
local path_display, style =
129+
utils.create_path_display(entry, vim.tbl_extend("force", opts, { disable_devicons = true }))
130130

131131
if entry.is_dir then
132132
if entry.path == parent_dir then
133-
path_display = ".."
133+
path_display = "../"
134134
end
135-
path_display = path_display .. os_sep
136135
end
137136

138137
if not opts.disable_devicons then
@@ -162,7 +161,12 @@ local make_entry = function(opts)
162161
if #path_display > file_width then
163162
path_display = strings.truncate(path_display, file_width, nil, -1)
164163
end
165-
local display = entry.is_dir and { path_display, "TelescopePreviewDirectory" } or path_display
164+
local display = {
165+
path_display,
166+
function()
167+
return style
168+
end,
169+
}
166170
table.insert(display_array, entry.stat and display or { display, "WarningMsg" })
167171
table.insert(widths, { width = file_width })
168172

0 commit comments

Comments
 (0)