diff --git a/lua/spacevim/plugin/guide.lua b/lua/spacevim/plugin/guide.lua index e0b190df8..ea6ec32e7 100644 --- a/lua/spacevim/plugin/guide.lua +++ b/lua/spacevim/plugin/guide.lua @@ -133,7 +133,9 @@ local function format_displaystring(map) end local display = vim.g['leaderGuide#displayname'] - vim.cmd('unlet g:leaderGuide#displayname') + if vim.g['leaderGuide#displayname'] then + vim.cmd('unlet g:leaderGuide#displayname') + end return display end @@ -271,7 +273,7 @@ local function start_parser(key, dict) mapd.lhs = cmp.fn.substitute(mapd.lhs, key, '', '') mapd.lhs = cmp.fn.substitute(mapd.lhs, '', ' ', 'g') mapd.lhs = cmp.fn.substitute(mapd.lhs, '', '', 'g') - mapd.rhs = cmp.fn.substitute(mapd.rhs, '', '' .. mapd['sid'] .. '_', 'g') + mapd.rhs = cmp.fn.substitute(mapd.rhs, '', '' .. (mapd['sid'] or '') .. '_', 'g') if mapd.lhs ~= '' and mapd.display ~= 'LeaderGuide.*' then mapd.lhs = string_to_keys(mapd.lhs) if