Skip to content

Commit

Permalink
Merge pull request #114 from Cassin01/features/#113
Browse files Browse the repository at this point in the history
Merge pull request #112 from Cassin01/Fixes#105
  • Loading branch information
Cassin01 authored Mar 9, 2024
2 parents fe5d942 + 999c0db commit 59bf2d5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lua/wf/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ local function objs_setup(fuzzy_obj, which_obj, output_obj, caller_obj, choices_
end

local which_key_list_operator = {
escape = "<C-C>",
toggle = "<C-T>",
escape = vim.g[full_name .. "#builtin_keymaps#escape"] or "<C-C>",
toggle = vim.g[full_name .. "#builtin_keymaps#toggle"] or "<C-T>",
}
for _, o in ipairs(objs) do
bmap(o.buf, "n", "<esc>", del, "quit")
Expand Down
13 changes: 10 additions & 3 deletions lua/wf/setup/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,8 @@ end
---@param opts? WFConfig
local function setup(opts)
opts = opts or { theme = "default" }
opts.highlight = opts["highlight"] or themes[opts["theme"] or "default"].highlight
local keymaps = opts["keymaps"] or {}

opts.highlight = opts["highlight"] or themes[opts["theme"] or "default"].highlight
for k, v in pairs(opts.highlight) do
if type(v) == "string" then
vim.api.nvim_set_hl(0, k, { default = true, link = v })
Expand All @@ -171,7 +170,15 @@ local function setup(opts)
end
vim.g[full_name .. "#theme"] = opts.theme

-- setup_keymap(keymaps)
opts["builtin_keymaps"] = opts["builtin_keymaps"]
or {
escape = "<C-C>", -- Accept null
toggle = "<C-T>", -- Not Accept null
}
opts["builtin_keymaps"]["escape"] = opts["builtin_keymaps"]["escape"] or "<C-C>"
opts["builtin_keymaps"]["toggle"] = opts["builtin_keymaps"]["toggle"] or "<C-T>"
vim.g[full_name .. "#builtin_keymaps#escape"] = opts["builtin_keymaps"]["escape"]
vim.g[full_name .. "#builtin_keymaps#toggle"] = opts["builtin_keymaps"]["toggle"]
end

return { setup = setup }

0 comments on commit 59bf2d5

Please sign in to comment.