Skip to content

Commit

Permalink
Merge pull request #108 from Cassin01/Fixes#105
Browse files Browse the repository at this point in the history
close #105
  • Loading branch information
Cassin01 authored Jan 21, 2024
2 parents 8a3c807 + 2b0ca5b commit 2a20265
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
22 changes: 10 additions & 12 deletions lua/wf/builtin/which_key.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,19 @@ local function feedkeys(lhs, count, caller, noremap)
end
end


local function leader()
local ml = vim.g["mapleader"]
if ml then
if ml == " " then
return "<Space>"
else
return ml
end
local ml = vim.g["mapleader"]
if ml then
if ml == " " then
return "<Space>"
else
return [[\]]
return ml
end
else
return [[\]]
end
end


---@tag wf.builtin.which_key
---@param opts? WFOptions
local function which_key(opts)
Expand All @@ -109,8 +107,8 @@ local function which_key(opts)
local count = vim.api.nvim_get_vvar("count")

opts = opts or { text_insert_in_advance = "" }
opts["text_insert_in_advance"] = string.gsub(opts["text_insert_in_advance"], "<Leader>", leader())
opts["text_insert_in_advance"] = string.gsub(opts["text_insert_in_advance"], "<leader>", leader())
opts["text_insert_in_advance"] =
string.gsub(opts["text_insert_in_advance"], "<Leader>", leader())
local _opts = {
title = "Which Key",
text_insert_in_advance = "",
Expand Down
1 change: 1 addition & 0 deletions lua/wf/which_map.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ local function setup(buf, black_list)
local map_list = map_list_gen(black_dict)
table.insert(map_list, "<C-@>")
table.insert(map_list, "<Space>")
table.insert(map_list, "<Tab>")
table.insert(map_list, "[")
table.insert(map_list, "{")
table.insert(map_list, "(")
Expand Down

0 comments on commit 2a20265

Please sign in to comment.