From ef0786098186adc00011e8197cfabf9fb1a2b18b Mon Sep 17 00:00:00 2001 From: TIAN Yuanhao Date: Wed, 10 Sep 2025 17:44:51 +0800 Subject: [PATCH] Wrap the `lhs_prefix` with single quotes Otherwise, when `` is the default `\`, the `lhs_prefix` will be escaped if wrapped in double quotes. Signed-off-by: TIAN Yuanhao --- autoload/showmap.vim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/autoload/showmap.vim b/autoload/showmap.vim index 63793df..52576b7 100644 --- a/autoload/showmap.vim +++ b/autoload/showmap.vim @@ -163,17 +163,17 @@ function! showmap#autobind(modes) if !has_key(binds, lhs_prefix) " don't overwrite map if one exists if maparg(lhs_prefix, mode) == '' - if !exists('g:showmap_autobind_exceptions["'.mode.'"]["'.lhs_prefix.'"]') - if (!exists('s:autobind_default_exceptions["'.mode.'"]["'.lhs_prefix.'"]') + if !exists("g:showmap_autobind_exceptions['".mode."']['".lhs_prefix."']") + if (!exists("s:autobind_default_exceptions['".mode."']['".lhs_prefix."']") \ || exists('g:showmap_no_autobind_default_exceptions')) " the binding is created here call showmap#bind_helper(lhs_prefix, mode) call s:log2file("showmap#bind_helper(".lhs_prefix.','.mode.')') else - call s:log2file(' autobind_default_exceptions["'.mode.'"]["'.lhs_prefix.'"]') + call s:log2file(" autobind_default_exceptions['".mode."']['".lhs_prefix."']") endif else - call s:log2file(' autobind_exceptions["'.mode.'"]["'.lhs_prefix.'"]') + call s:log2file(" autobind_exceptions['".mode."']['".lhs_prefix."']") endif endif let binds[lhs_prefix] = 1