From 4210dc3db6abcc32d44f39ff9952514c33a68aff Mon Sep 17 00:00:00 2001 From: max397574 Date: Sat, 18 Dec 2021 09:09:29 +0100 Subject: fix(themes): don't break startify if no bookmarks --- lua/startup/themes/startify.lua | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'lua/startup') diff --git a/lua/startup/themes/startify.lua b/lua/startup/themes/startify.lua index 91362fb..bcb50e5 100644 --- a/lua/startup/themes/startify.lua +++ b/lua/startup/themes/startify.lua @@ -1,15 +1,20 @@ local user_bookmarks = vim.g.startup_bookmarks local bookmark_texts = { "Bookmarks", "" } +local user_bookmark_mappings = {} -for key, file in pairs(user_bookmarks) do - bookmark_texts[#bookmark_texts + 1] = key .. " " .. file +if not user_bookmarks then + user_bookmarks = {} + bookmark_texts = {} end -local user_bookmark_mappings = {} -for key, file in pairs(user_bookmarks) do - user_bookmark_mappings[key] = "e " .. file .. "" -end + for key, file in pairs(user_bookmarks) do + bookmark_texts[#bookmark_texts + 1] = key .. " " .. file + end + + for key, file in pairs(user_bookmarks) do + user_bookmark_mappings[key] = "e " .. file .. "" + end local cow = { " \\ ^__^", " \\ (oo)\\_______", -- cgit v1.2.3