Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
neovim_version: ["v0.10.4", "v0.11.3", "nightly"]
neovim_version: ["v0.11.3", "nightly"]
include:
- os: macos-latest
neovim_version: v0.11.3
Expand Down
11 changes: 10 additions & 1 deletion lua/python/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,18 @@ local function tbl_deep_extend_existing(target, source, prev_key)
-- Overwrite existing key
target[key] = value
end
elseif type(key) == "number" then
-- If the key is a number then we can assume
-- that this is a table that is supposed to be a list
goto continue
else
error(("python.nvim: user inputted config key: %s is not found in config table: %s"):format(key, prev_key))
vim.notify(
("python.nvim: user inputted config key: %s is not found in config table: %s"):format(key, prev_key),
vim.log.levels.WARN
)
goto continue
end
::continue::
end
return target
end
Expand Down
8 changes: 5 additions & 3 deletions tests/test_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ T["setup"]["override"] = function()
end

T["setup"]["not_found"] = function()
expect.error(function()
child.lua("config.setup({ ui = { popup = {foobar = true}} })")
end, ".*user inputted config key: foobar is not found.*")
child.lua("config.setup({ ui = { popup = {foobar = true}} })")
eq(
child.lua([[return vim.split(vim.fn.execute("messages", "silent"), "\n")]]),
{ "", "python.nvim: user inputted config key: foobar is not found in config table: config.ui.popup" }
)
end

-- Return test set which will be collected and execute inside `MiniTest.run()`
Expand Down