Skip to content

Commit 1f64dd6

Browse files
committed
fix: Warn users about configuration cchange and do not break plugin
1 parent 97bc09c commit 1f64dd6

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
uses: kdheepak/panvimdoc@main
3030
with:
3131
vimdoc: CopilotChat
32+
dedupsubheadings: false
3233
treesitter: true
3334
- uses: stefanzweifel/git-auto-commit-action@v5
3435
with:

lua/CopilotChat/init.lua

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,25 @@ end
528528
--- Set up the plugin
529529
---@param config CopilotChat.config|nil
530530
function M.setup(config)
531+
-- Handle old mapping format and show error
532+
local found_old_format = false
533+
if config and config.mappings then
534+
for name, key in pairs(config.mappings) do
535+
if type(key) == 'string' then
536+
vim.notify(
537+
'config.mappings.'
538+
.. name
539+
.. ": 'mappings' format have changed, please update your configuration, for now revering to default settings. See ':help CopilotChat-configuration' for current format",
540+
vim.log.levels.ERROR
541+
)
542+
found_old_format = true
543+
end
544+
end
545+
end
546+
if found_old_format then
547+
config.mappings = nil
548+
end
549+
531550
M.config = vim.tbl_deep_extend('force', default_config, config or {})
532551
state.copilot = Copilot(M.config.proxy, M.config.allow_insecure)
533552
local mark_ns = vim.api.nvim_create_namespace('copilot-chat-marks')

0 commit comments

Comments
 (0)