Skip to content

Commit

Permalink
work with no web-devicons plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
glepnir committed Jun 25, 2024
1 parent 4f7f936 commit 23aca26
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
20 changes: 11 additions & 9 deletions lua/dashboard/theme/hyper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ local function mru_list(config)
for _, file in pairs(vim.list_slice(mlist, 1, config.mru.limit)) do
local filename = vim.fn.fnamemodify(file, ':t')
local icon, group = utils.get_icon(filename)
icon = icon or ''
icon = icon or ''
if config.mru.cwd_only then
file = vim.fn.fnamemodify(file, ':.')
elseif not utils.is_win then
Expand Down Expand Up @@ -405,14 +405,16 @@ local function gen_center(plist, config)

for i, data in pairs(mgroups) do
local len, group = unpack(data)
api.nvim_buf_add_highlight(
config.bufnr,
0,
group,
first_line + i + plist_len,
start_col,
start_col + len
)
if group then
api.nvim_buf_add_highlight(
config.bufnr,
0,
group,
first_line + i + plist_len,
start_col,
start_col + len
)
end
api.nvim_buf_add_highlight(
config.bufnr,
0,
Expand Down
1 change: 0 additions & 1 deletion lua/dashboard/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ end
function utils.get_icon(filename)
local ok, devicons = pcall(require, 'nvim-web-devicons')
if not ok then
vim.notify('[dashboard.nvim] not found nvim-web-devicons')
return nil
end
return devicons.get_icon(filename, nil, { default = true })
Expand Down

0 comments on commit 23aca26

Please sign in to comment.