fix(keys): Use vim's default value for an unset g:mapleader (#316)

This commit is contained in:
Tsakiris Tryfon 2023-01-04 15:02:48 +02:00 committed by GitHub
parent d5e6bdf90c
commit 3bde7b5ba8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -15,7 +15,7 @@ local M = {}
---@param feed string ---@param feed string
function M.replace_special(feed) function M.replace_special(feed)
for special, key in pairs({ leader = vim.g.mapleader, localleader = vim.g.maplocalleader }) do for special, key in pairs({ leader = vim.g.mapleader or "\\", localleader = vim.g.maplocalleader or "\\" }) do
local pattern = "<" local pattern = "<"
for i = 1, #special do for i = 1, #special do
pattern = pattern .. "[" .. special:sub(i, i) .. special:upper():sub(i, i) .. "]" pattern = pattern .. "[" .. special:sub(i, i) .. special:upper():sub(i, i) .. "]"