Skip to content
This repository was archived by the owner on Feb 20, 2025. It is now read-only.

Commit 08719cc

Browse files
committed
fix(guide): fix g guide map
close #4931
1 parent fc4714f commit 08719cc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lua/spacevim/plugin/guide.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,9 @@ local function format_displaystring(map)
133133
end
134134

135135
local display = vim.g['leaderGuide#displayname']
136-
vim.cmd('unlet g:leaderGuide#displayname')
136+
if vim.g['leaderGuide#displayname'] then
137+
vim.cmd('unlet g:leaderGuide#displayname')
138+
end
137139
return display
138140
end
139141

@@ -271,7 +273,7 @@ local function start_parser(key, dict)
271273
mapd.lhs = cmp.fn.substitute(mapd.lhs, key, '', '')
272274
mapd.lhs = cmp.fn.substitute(mapd.lhs, '<Space>', ' ', 'g')
273275
mapd.lhs = cmp.fn.substitute(mapd.lhs, '<Tab>', '<C-I>', 'g')
274-
mapd.rhs = cmp.fn.substitute(mapd.rhs, '<SID>', '<SNR>' .. mapd['sid'] .. '_', 'g')
276+
mapd.rhs = cmp.fn.substitute(mapd.rhs, '<SID>', '<SNR>' .. (mapd['sid'] or '') .. '_', 'g')
275277
if mapd.lhs ~= '' and mapd.display ~= 'LeaderGuide.*' then
276278
mapd.lhs = string_to_keys(mapd.lhs)
277279
if

0 commit comments

Comments
 (0)