ci: format
This commit is contained in:
parent
0e88e0f182
commit
72ea6249f4
3 changed files with 24 additions and 12 deletions
|
|
@ -306,7 +306,9 @@ function M.setup_problem(problem_id, language)
|
||||||
local s = config.hooks and config.hooks.setup
|
local s = config.hooks and config.hooks.setup
|
||||||
if s and s.code then
|
if s and s.code then
|
||||||
local ok = pcall(s.code, state)
|
local ok = pcall(s.code, state)
|
||||||
if ok then vim.b[prov.bufnr].cp_setup_done = true end
|
if ok then
|
||||||
|
vim.b[prov.bufnr].cp_setup_done = true
|
||||||
|
end
|
||||||
else
|
else
|
||||||
helpers.clearcol(prov.bufnr)
|
helpers.clearcol(prov.bufnr)
|
||||||
vim.b[prov.bufnr].cp_setup_done = true
|
vim.b[prov.bufnr].cp_setup_done = true
|
||||||
|
|
@ -316,7 +318,9 @@ function M.setup_problem(problem_id, language)
|
||||||
local bufnr = prov.bufnr
|
local bufnr = prov.bufnr
|
||||||
vim.api.nvim_create_autocmd('BufEnter', {
|
vim.api.nvim_create_autocmd('BufEnter', {
|
||||||
buffer = bufnr,
|
buffer = bufnr,
|
||||||
callback = function() pcall(o.enter, state) end,
|
callback = function()
|
||||||
|
pcall(o.enter, state)
|
||||||
|
end,
|
||||||
})
|
})
|
||||||
pcall(o.enter, state)
|
pcall(o.enter, state)
|
||||||
end
|
end
|
||||||
|
|
@ -351,7 +355,9 @@ function M.setup_problem(problem_id, language)
|
||||||
local s = config.hooks and config.hooks.setup
|
local s = config.hooks and config.hooks.setup
|
||||||
if s and s.code then
|
if s and s.code then
|
||||||
local ok = pcall(s.code, state)
|
local ok = pcall(s.code, state)
|
||||||
if ok then vim.b[bufnr].cp_setup_done = true end
|
if ok then
|
||||||
|
vim.b[bufnr].cp_setup_done = true
|
||||||
|
end
|
||||||
else
|
else
|
||||||
helpers.clearcol(bufnr)
|
helpers.clearcol(bufnr)
|
||||||
vim.b[bufnr].cp_setup_done = true
|
vim.b[bufnr].cp_setup_done = true
|
||||||
|
|
@ -360,7 +366,9 @@ function M.setup_problem(problem_id, language)
|
||||||
if o and o.enter then
|
if o and o.enter then
|
||||||
vim.api.nvim_create_autocmd('BufEnter', {
|
vim.api.nvim_create_autocmd('BufEnter', {
|
||||||
buffer = bufnr,
|
buffer = bufnr,
|
||||||
callback = function() pcall(o.enter, state) end,
|
callback = function()
|
||||||
|
pcall(o.enter, state)
|
||||||
|
end,
|
||||||
})
|
})
|
||||||
pcall(o.enter, state)
|
pcall(o.enter, state)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -960,10 +960,14 @@ function M.toggle_panel(panel_opts)
|
||||||
|
|
||||||
local o = config.hooks and config.hooks.on
|
local o = config.hooks and config.hooks.on
|
||||||
if o and o.run then
|
if o and o.run then
|
||||||
vim.schedule(function() o.run(state) end)
|
vim.schedule(function()
|
||||||
|
o.run(state)
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
if panel_opts and panel_opts.debug and o and o.debug then
|
if panel_opts and panel_opts.debug and o and o.debug then
|
||||||
vim.schedule(function() o.debug(state) end)
|
vim.schedule(function()
|
||||||
|
o.debug(state)
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.api.nvim_set_current_win(test_windows.tab_win)
|
vim.api.nvim_set_current_win(test_windows.tab_win)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue