fix: pass in index to :CP panel <n>
This commit is contained in:
parent
f6b27b9089
commit
4affabcae3
1 changed files with 8 additions and 0 deletions
|
|
@ -2,6 +2,7 @@ local M = {}
|
|||
|
||||
---@class PanelOpts
|
||||
---@field debug? boolean
|
||||
---@field test_index? integer
|
||||
|
||||
local cache = require('cp.cache')
|
||||
local config_module = require('cp.config')
|
||||
|
|
@ -806,6 +807,13 @@ function M.toggle_panel(panel_opts)
|
|||
return
|
||||
end
|
||||
|
||||
if panel_opts and panel_opts.test_index then
|
||||
local test_state = run.get_panel_state()
|
||||
if panel_opts.test_index >= 1 and panel_opts.test_index <= #test_state.test_cases then
|
||||
test_state.current_index = panel_opts.test_index
|
||||
end
|
||||
end
|
||||
|
||||
local io_state = state.get_io_view_state()
|
||||
if io_state then
|
||||
for _, win in ipairs(vim.api.nvim_list_wins()) do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue