refactor lang to constants
This commit is contained in:
parent
6893271547
commit
5d630d9dac
6 changed files with 197 additions and 9 deletions
|
|
@ -3,8 +3,9 @@ if vim.g.loaded_cp then
|
|||
end
|
||||
vim.g.loaded_cp = 1
|
||||
|
||||
local platforms = { "atcoder", "codeforces", "cses" }
|
||||
local actions = { "run", "debug", "next", "prev" }
|
||||
local constants = require("cp.constants")
|
||||
local platforms = constants.PLATFORMS
|
||||
local actions = constants.ACTIONS
|
||||
|
||||
vim.api.nvim_create_user_command("CP", function(opts)
|
||||
local cp = require("cp")
|
||||
|
|
@ -13,8 +14,7 @@ end, {
|
|||
nargs = "*",
|
||||
desc = "Competitive programming helper",
|
||||
complete = function(ArgLead, CmdLine, _)
|
||||
local languages_module = require("cp.languages")
|
||||
local languages = vim.tbl_keys(languages_module.canonical_filetypes)
|
||||
local languages = vim.tbl_keys(constants.canonical_filetypes)
|
||||
|
||||
if ArgLead:match("^--lang=") then
|
||||
local lang_completions = {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue