Compare commits

...
Sign in to create a new pull request.

3 commits

Author SHA1 Message Date
618dfdb926 docs: add blank lines before code blocks for readability 2026-02-05 11:35:50 -05:00
Barrett Ruth
b2c7f16890
Merge pull request #234 from barrettruth/fix/deprecation-warning
Some checks are pending
luarocks / ci (push) Waiting to run
luarocks / publish (push) Blocked by required conditions
fix: add deprecation warning for setup()
2026-02-03 21:51:19 -05:00
276241447c fix: add deprecation warning for setup()
Some checks are pending
luarocks / ci (push) Waiting to run
luarocks / publish (push) Blocked by required conditions
2026-02-03 21:46:47 -05:00
2 changed files with 13 additions and 0 deletions

View file

@ -206,6 +206,7 @@ Debug Builds ~
CONFIGURATION *cp-config* CONFIGURATION *cp-config*
Configuration is done via `vim.g.cp_config`. Set this before using the plugin: Configuration is done via `vim.g.cp_config`. Set this before using the plugin:
>lua >lua
vim.g.cp_config = { vim.g.cp_config = {
languages = { languages = {
@ -273,6 +274,7 @@ By default, C++ (g++ with ISO C++17) and Python are preconfigured under
the default; per-platform overrides can tweak 'extension' or 'commands'. the default; per-platform overrides can tweak 'extension' or 'commands'.
For example, to run CodeForces contests with Python by default: For example, to run CodeForces contests with Python by default:
>lua >lua
vim.g.cp_config = { vim.g.cp_config = {
platforms = { platforms = {
@ -282,8 +284,10 @@ For example, to run CodeForces contests with Python by default:
}, },
} }
< <
Any language is supported provided the proper configuration. For example, to Any language is supported provided the proper configuration. For example, to
run CSES problems with Rust using the single schema: run CSES problems with Rust using the single schema:
>lua >lua
vim.g.cp_config = { vim.g.cp_config = {
languages = { languages = {

View file

@ -34,4 +34,13 @@ function M.is_initialized()
return initialized return initialized
end end
---@deprecated Use `vim.g.cp_config` instead
function M.setup(user_config)
vim.deprecate('require("cp").setup()', 'vim.g.cp_config', 'v0.1.0', 'cp.nvim', false)
if user_config then
vim.g.cp_config = vim.tbl_deep_extend('force', vim.g.cp_config or {}, user_config)
end
end
return M return M