Skip to content

Commit fa5ade5

Browse files
committed
refactor: make stylua happy
1 parent 1ff8504 commit fa5ade5

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

lua/copilot/keymaps/init.lua

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -151,21 +151,17 @@ function M.validate(config)
151151

152152
for _, cfg in ipairs({ suggestion_keymaps, nes_keymaps, panel_keymaps }) do
153153
for action, km in pairs(cfg) do
154-
if not km then
155-
goto continue
154+
if km then
155+
-- TODO: find a better way to determine mode, this is prone to maintenance bugs
156+
-- TODO: Not sure how to validate keymaps, since some COULD be duplicates and valid
157+
local mode = (action == config.panel.keymap.open or vim.tbl_contains(config.nes.keymap, action)) and "n" or "i"
158+
local keymap_key = get_keymap_key(0, mode, km)
159+
if seen[keymap_key] then
160+
duplicates[keymap_key] = (duplicates[keymap_key] or 1) + 1
161+
else
162+
seen[keymap_key] = true
163+
end
156164
end
157-
158-
-- TODO: find a better way to determine mode, this is prone to maintenance bugs
159-
-- TODO: Not sure how to validate keymaps, since some COULD be duplicates and valid
160-
local mode = (action == config.panel.keymap.open or vim.tbl_contains(config.nes.keymap, action)) and "n" or "i"
161-
local keymap_key = get_keymap_key(0, mode, km)
162-
if seen[keymap_key] then
163-
duplicates[keymap_key] = (duplicates[keymap_key] or 1) + 1
164-
else
165-
seen[keymap_key] = true
166-
end
167-
168-
::continue::
169165
end
170166
end
171167

0 commit comments

Comments
 (0)