diff --git a/doc/telescope.txt b/doc/telescope.txt index 0c8ebd3..81a7006 100644 --- a/doc/telescope.txt +++ b/doc/telescope.txt @@ -886,13 +886,16 @@ builtin.treesitter() *telescope.builtin.treesitter()* Options: ~ - {show_line} (boolean) if true, shows the row:column that the - result is found at (default: true) - {bufnr} (number) specify the buffer number where - treesitter should run. (default: - current buffer) - {symbol_highlights} (table) string -> string. Matches symbol with - hl_group + {show_line} (boolean) if true, shows the row:column that + the result is found at (default: + true) + {bufnr} (number) specify the buffer number where + treesitter should run. (default: + current buffer) + {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()* diff --git a/lua/telescope/make_entry.lua b/lua/telescope/make_entry.lua index 272524b..97f1be6 100644 --- a/lua/telescope/make_entry.lua +++ b/lua/telescope/make_entry.lua @@ -157,13 +157,13 @@ do mt_file_entry.cwd = cwd mt_file_entry.display = function(entry) - local hl_group + local hl_group, icon 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 - return display, { { { 1, 3 }, hl_group } } + return display, { { { 1, #icon }, hl_group } } else return display end @@ -326,14 +326,14 @@ do end end - local display, hl_group = utils.transform_devicons( + local display, hl_group, icon = utils.transform_devicons( entry.filename, string.format(display_string, display_filename, coordinates, entry.text), disable_devicons ) if hl_group then - return display, { { { 1, 3 }, hl_group } } + return display, { { { 1, #icon }, hl_group } } else return display end diff --git a/lua/telescope/utils.lua b/lua/telescope/utils.lua index 0ef0e06..e0c5e24 100644 --- a/lua/telescope/utils.lua +++ b/lua/telescope/utils.lua @@ -440,13 +440,14 @@ utils.transform_devicons = load_once(function() local icon, icon_highlight = devicons.get_icon(basename, utils.file_extension(basename), { default = false }) if not icon then icon, icon_highlight = devicons.get_icon(basename, nil, { default = true }) + icon = icon or " " end - local icon_display = (icon or " ") .. " " .. (display or "") + local icon_display = icon .. " " .. (display or "") if conf.color_devicons then - return icon_display, icon_highlight + return icon_display, icon_highlight, icon else - return icon_display, nil + return icon_display, nil, icon end end else