Skip to content
This repository was archived by the owner on Dec 7, 2025. It is now read-only.

Commit e268601

Browse files
author
Caio Daniel Nunes Santos
committed
Disambiguate field "keys" from method with the same name.
The method "keys" raised an error that I was trying to call a table. I just renamed the field "keys" to "mappings'.
1 parent 68b8aa0 commit e268601

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lua/strive/init.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ function Plugin.new(spec)
607607
events = {}, -- Events to trigger loading
608608
filetypes = {}, -- Filetypes to trigger loading
609609
commands = {}, -- Commands to trigger loading
610-
keys = {}, -- Keys to trigger loading
610+
mappings = {}, -- Keys to trigger loading
611611

612612
-- Configuration
613613
setup_opts = spec.setup or {}, -- Options for plugin setup()
@@ -924,9 +924,9 @@ end
924924
-- Set up lazy loading for specific keymaps
925925
function Plugin:keys(mappings)
926926
self.is_lazy = true
927-
self.keys = type(mappings) ~= 'table' and { mappings } or mappings
927+
self.mappings = type(mappings) ~= 'table' and { mappings } or mappings
928928

929-
for _, mapping in ipairs(self.keys) do
929+
for _, mapping in ipairs(self.mappings) do
930930
local mode, lhs, rhs, opts
931931

932932
if type(mapping) == 'table' then

0 commit comments

Comments
 (0)