fix(keys): don't ignore modes that aren't 'n' (#28)

* fix(keys): don't ignore modes that aren't `'n'`

Fixes #26

* chore(deps): update flake.lock

* ci: remove docgen workflow
This commit is contained in:
Marc Jakobi
2024-06-29 15:37:28 +02:00
committed by GitHub
parent 2b9b3ee2a4
commit 8886765a2f
9 changed files with 104 additions and 137 deletions
+6 -6
View File
@@ -16,9 +16,9 @@ describe("handlers.keys", function()
}
for _, test in ipairs(tests) do
if test[3] then
assert.same(keys.parse(test[1]).id, keys.parse(test[2]).id)
assert.same(keys.parse(test[1])[1].id, keys.parse(test[2])[1].id)
else
assert.is_not.same(keys.parse(test[1]).id, keys.parse(test[2]).id)
assert.is_not.same(keys.parse(test[1])[1].id, keys.parse(test[2])[1].id)
end
end
end)
@@ -27,7 +27,7 @@ describe("handlers.keys", function()
---@type lz.n.Plugin
local plugin = {
name = "foo",
keys = { keys.parse(lhs) },
keys = keys.parse(lhs),
}
local spy_load = spy.on(loader, "_load")
state.plugins[plugin.name] = plugin
@@ -55,15 +55,15 @@ describe("handlers.keys", function()
vim.api.nvim_feedkeys(feed2, "ix", false)
assert.spy(spy_load).called(1)
end
itt({ keys.parse("<leader>tt"), keys.parse("<leader>ff") })
itt({ keys.parse("<leader>ff"), keys.parse("<leader>tt") })
itt({ keys.parse("<leader>tt")[1], keys.parse("<leader>ff")[1] })
itt({ keys.parse("<leader>ff")[1], keys.parse("<leader>tt")[1] })
end)
it("Plugins' keymaps are triggered", function()
local lhs = "<leader>xy"
---@type lz.n.Plugin
local plugin = {
name = "baz",
keys = { keys.parse(lhs) },
keys = keys.parse(lhs),
}
local triggered = false
local orig_load = loader._load