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

View File

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