1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 08:00:04 +08:00

fix(guide): fix g guide map

close https://github.com/SpaceVim/SpaceVim/issues/4931
This commit is contained in:
Eric Wong 2024-11-05 20:33:09 +08:00
parent fc4714f6f6
commit 08719ccab2

View File

@ -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, '<Space>', ' ', 'g')
mapd.lhs = cmp.fn.substitute(mapd.lhs, '<Tab>', '<C-I>', 'g')
mapd.rhs = cmp.fn.substitute(mapd.rhs, '<SID>', '<SNR>' .. mapd['sid'] .. '_', 'g')
mapd.rhs = cmp.fn.substitute(mapd.rhs, '<SID>', '<SNR>' .. (mapd['sid'] or '') .. '_', 'g')
if mapd.lhs ~= '' and mapd.display ~= 'LeaderGuide.*' then
mapd.lhs = string_to_keys(mapd.lhs)
if