From 276241447c3699f56704d286d6e343adcf019867 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Tue, 3 Feb 2026 21:46:47 -0500 Subject: [PATCH 1/2] fix: add deprecation warning for setup() --- lua/cp/init.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lua/cp/init.lua b/lua/cp/init.lua index fac3044..0bb5582 100644 --- a/lua/cp/init.lua +++ b/lua/cp/init.lua @@ -34,4 +34,13 @@ function M.is_initialized() return initialized 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 From 618dfdb9265e471b8ab8df354a67bb78c7da25ff Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Thu, 5 Feb 2026 11:35:50 -0500 Subject: [PATCH 2/2] docs: add blank lines before code blocks for readability --- doc/cp.nvim.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/cp.nvim.txt b/doc/cp.nvim.txt index d6d1d73..5943cca 100644 --- a/doc/cp.nvim.txt +++ b/doc/cp.nvim.txt @@ -206,6 +206,7 @@ Debug Builds ~ CONFIGURATION *cp-config* Configuration is done via `vim.g.cp_config`. Set this before using the plugin: + >lua vim.g.cp_config = { 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'. For example, to run CodeForces contests with Python by default: + >lua vim.g.cp_config = { 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 run CSES problems with Rust using the single schema: + >lua vim.g.cp_config = { languages = {