fix formatting;
This commit is contained in:
parent
0db6fa96b4
commit
03807e46e0
4 changed files with 15 additions and 14 deletions
|
|
@ -21,7 +21,6 @@ local function get_plugin_path()
|
||||||
return vim.fn.fnamemodify(plugin_path, ":h:h:h")
|
return vim.fn.fnamemodify(plugin_path, ":h:h:h")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
local competition_types = { "atcoder", "codeforces", "cses" }
|
local competition_types = { "atcoder", "codeforces", "cses" }
|
||||||
|
|
||||||
local function setup_contest(contest_type)
|
local function setup_contest(contest_type)
|
||||||
|
|
@ -58,7 +57,7 @@ local function setup_problem(problem_id, problem_letter)
|
||||||
vim.g.cp_diff_mode = false
|
vim.g.cp_diff_mode = false
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.cmd('silent only')
|
vim.cmd("silent only")
|
||||||
|
|
||||||
local scrape_result = scrape.scrape_problem(vim.g.cp_contest, problem_id, problem_letter)
|
local scrape_result = scrape.scrape_problem(vim.g.cp_contest, problem_id, problem_letter)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ function M.restore_layout(state)
|
||||||
end
|
end
|
||||||
|
|
||||||
if problem_id ~= "" then
|
if problem_id ~= "" then
|
||||||
vim.cmd('silent only')
|
vim.cmd("silent only")
|
||||||
|
|
||||||
local base_fp = vim.fn.getcwd()
|
local base_fp = vim.fn.getcwd()
|
||||||
local input = ("%s/io/%s.in"):format(base_fp, problem_id)
|
local input = ("%s/io/%s.in"):format(base_fp, problem_id)
|
||||||
|
|
@ -86,7 +86,7 @@ end
|
||||||
|
|
||||||
function M.setup_diff_layout(actual_output, expected_output, input_file)
|
function M.setup_diff_layout(actual_output, expected_output, input_file)
|
||||||
vim.cmd.diffoff()
|
vim.cmd.diffoff()
|
||||||
vim.cmd('silent only')
|
vim.cmd("silent only")
|
||||||
|
|
||||||
local output_lines = vim.split(actual_output, "\n")
|
local output_lines = vim.split(actual_output, "\n")
|
||||||
local output_buf = vim.api.nvim_create_buf(false, true)
|
local output_buf = vim.api.nvim_create_buf(false, true)
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,9 @@ def main():
|
||||||
test_cases.append({"input": input_data, "output": output_data})
|
test_cases.append({"input": input_data, "output": output_data})
|
||||||
|
|
||||||
if test_cases:
|
if test_cases:
|
||||||
combined_input = str(len(test_cases)) + "\n" + "\n".join(tc["input"] for tc in test_cases)
|
combined_input = (
|
||||||
|
str(len(test_cases)) + "\n" + "\n".join(tc["input"] for tc in test_cases)
|
||||||
|
)
|
||||||
combined_output = "\n".join(tc["output"] for tc in test_cases)
|
combined_output = "\n".join(tc["output"] for tc in test_cases)
|
||||||
test_cases = [{"input": combined_input, "output": combined_output}]
|
test_cases = [{"input": combined_input, "output": combined_output}]
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue