Skip to content

Commit 23aca26

Browse files
committed
work with no web-devicons plugin
1 parent 4f7f936 commit 23aca26

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

lua/dashboard/theme/hyper.lua

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ local function mru_list(config)
189189
for _, file in pairs(vim.list_slice(mlist, 1, config.mru.limit)) do
190190
local filename = vim.fn.fnamemodify(file, ':t')
191191
local icon, group = utils.get_icon(filename)
192-
icon = icon or ''
192+
icon = icon or ''
193193
if config.mru.cwd_only then
194194
file = vim.fn.fnamemodify(file, ':.')
195195
elseif not utils.is_win then
@@ -405,14 +405,16 @@ local function gen_center(plist, config)
405405

406406
for i, data in pairs(mgroups) do
407407
local len, group = unpack(data)
408-
api.nvim_buf_add_highlight(
409-
config.bufnr,
410-
0,
411-
group,
412-
first_line + i + plist_len,
413-
start_col,
414-
start_col + len
415-
)
408+
if group then
409+
api.nvim_buf_add_highlight(
410+
config.bufnr,
411+
0,
412+
group,
413+
first_line + i + plist_len,
414+
start_col,
415+
start_col + len
416+
)
417+
end
416418
api.nvim_buf_add_highlight(
417419
config.bufnr,
418420
0,

lua/dashboard/utils.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ end
6464
function utils.get_icon(filename)
6565
local ok, devicons = pcall(require, 'nvim-web-devicons')
6666
if not ok then
67-
vim.notify('[dashboard.nvim] not found nvim-web-devicons')
6867
return nil
6968
end
7069
return devicons.get_icon(filename, nil, { default = true })

0 commit comments

Comments
 (0)