fix: icons with multiple dots but without custom overrides (#2256)

This commit is contained in:
Simon Hauser
2022-12-02 10:21:44 +01:00
committed by GitHub
parent f37c603303
commit 361a172fce
2 changed files with 42 additions and 30 deletions

View File

@@ -838,26 +838,31 @@ builtin.find_files({opts}) *telescope.builtin.find_files()*
{opts} (table) options to pass to the picker
Options: ~
{cwd} (string) root dir to search from (default:
cwd, use utils.buffer_dir() to
search relative to open buffer)
{find_command} (function|table) cmd to use for the search. Can be
a fn(opts) -> tbl (default:
autodetect)
{file_entry_encoding} (string) encoding of output of `find_command`
{follow} (boolean) if true, follows symlinks (i.e.
uses `-L` flag for the `find`
command)
{hidden} (boolean) determines whether to show hidden
files or not (default: false)
{no_ignore} (boolean) show files ignored by .gitignore,
.ignore, etc. (default: false)
{no_ignore_parent} (boolean) show files ignored by .gitignore,
.ignore, etc. in parent dirs.
(default: false)
{search_dirs} (table) directory/directories/files to
search
{search_file} (string) specify a filename to search for
{cwd} (string) root dir to search from
(default: cwd, use
utils.buffer_dir() to search
relative to open buffer)
{find_command} (function|table) cmd to use for the search. Can
be a fn(opts) -> tbl (default:
autodetect)
{file_entry_encoding} (string) encoding of output of
`find_command`
{follow} (boolean) if true, follows symlinks
(i.e. uses `-L` flag for the
`find` command)
{hidden} (boolean) determines whether to show
hidden files or not (default:
false)
{no_ignore} (boolean) show files ignored by
.gitignore, .ignore, etc.
(default: false)
{no_ignore_parent} (boolean) show files ignored by
.gitignore, .ignore, etc. in
parent dirs. (default: false)
{search_dirs} (table) directory/directories/files to
search
{search_file} (string) specify a filename to search
for
builtin.fd() *telescope.builtin.fd()*
@@ -1344,14 +1349,15 @@ builtin.keymaps({opts}) *telescope.builtin.keymaps()*
{opts} (table) options to pass to the picker
Options: ~
{modes} (table) a list of short-named keymap modes to search
(default: { "n", "i", "c", "x" })
{show_plug} (boolean) if true, the keymaps for which the lhs contains
"<Plug>" are also shown (default: true)
{only_buf} (boolean) if true, only show the buffer-local keymaps
(default: false)
{lhs_filter} (function) filter(lhs:string) -> boolean. true if the
keymap should be shown (optional)
{modes} (table) a list of short-named keymap modes to search
(default: { "n", "i", "c", "x" })
{show_plug} (boolean) if true, the keymaps for which the lhs
contains "<Plug>" are also shown (default:
true)
{only_buf} (boolean) if true, only show the buffer-local keymaps
(default: false)
{lhs_filter} (function) filter(lhs:string) -> boolean. true if the
keymap should be shown (optional)
builtin.filetypes({opts}) *telescope.builtin.filetypes()*

View File

@@ -457,7 +457,10 @@ utils.transform_devicons = load_once(function()
end
local basename = utils.path_tail(filename)
local icon, icon_highlight = devicons.get_icon(basename, utils.file_extension(basename), { default = true })
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 })
end
local icon_display = (icon or " ") .. " " .. (display or "")
if conf.color_devicons then
@@ -488,7 +491,10 @@ utils.get_devicons = load_once(function()
end
local basename = utils.path_tail(filename)
local icon, icon_highlight = devicons.get_icon(basename, utils.file_extension(basename), { default = true })
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 })
end
if conf.color_devicons then
return icon, icon_highlight
else