fix(ci): unused vars
This commit is contained in:
parent
2c994a8bdc
commit
c1529c5d91
4 changed files with 18 additions and 5 deletions
|
|
@ -82,6 +82,11 @@ local function contest_picker(platform)
|
||||||
problem_picker(platform, contest.id)
|
problem_picker(platform, contest.id)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
['ctrl-r'] = function()
|
||||||
|
local cache = require('cp.cache')
|
||||||
|
cache.clear_contest_list(platform)
|
||||||
|
contest_picker(platform)
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ local function contest_picker(opts, platform)
|
||||||
end,
|
end,
|
||||||
}),
|
}),
|
||||||
sorter = conf.generic_sorter(opts),
|
sorter = conf.generic_sorter(opts),
|
||||||
attach_mappings = function(prompt_bufnr)
|
attach_mappings = function(prompt_bufnr, map)
|
||||||
actions.select_default:replace(function()
|
actions.select_default:replace(function()
|
||||||
local selection = action_state.get_selected_entry()
|
local selection = action_state.get_selected_entry()
|
||||||
actions.close(prompt_bufnr)
|
actions.close(prompt_bufnr)
|
||||||
|
|
@ -84,6 +84,14 @@ local function contest_picker(opts, platform)
|
||||||
problem_picker(opts, platform, selection.value.id)
|
problem_picker(opts, platform, selection.value.id)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
map('i', '<C-r>', function()
|
||||||
|
local cache = require('cp.cache')
|
||||||
|
cache.clear_contest_list(platform)
|
||||||
|
actions.close(prompt_bufnr)
|
||||||
|
contest_picker(opts, platform)
|
||||||
|
end)
|
||||||
|
|
||||||
return true
|
return true
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ describe('cp.picker', function()
|
||||||
it('returns problems from cache when available', function()
|
it('returns problems from cache when available', function()
|
||||||
local cache = require('cp.cache')
|
local cache = require('cp.cache')
|
||||||
cache.load = function() end
|
cache.load = function() end
|
||||||
cache.get_contest_data = function(platform, contest_id)
|
cache.get_contest_data = function()
|
||||||
return {
|
return {
|
||||||
problems = {
|
problems = {
|
||||||
{ id = 'a', name = 'Problem A' },
|
{ id = 'a', name = 'Problem A' },
|
||||||
|
|
@ -131,7 +131,7 @@ describe('cp.picker', function()
|
||||||
cache.get_contest_data = function()
|
cache.get_contest_data = function()
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
scrape.scrape_contest_metadata = function(platform, contest_id)
|
scrape.scrape_contest_metadata = function()
|
||||||
return {
|
return {
|
||||||
success = true,
|
success = true,
|
||||||
problems = {
|
problems = {
|
||||||
|
|
@ -154,7 +154,7 @@ describe('cp.picker', function()
|
||||||
cache.get_contest_data = function()
|
cache.get_contest_data = function()
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
scrape.scrape_contest_metadata = function(platform, contest_id)
|
scrape.scrape_contest_metadata = function()
|
||||||
return {
|
return {
|
||||||
success = false,
|
success = false,
|
||||||
error = 'test error',
|
error = 'test error',
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ describe('cp.telescope', function()
|
||||||
|
|
||||||
package.preload['telescope.pickers'] = function()
|
package.preload['telescope.pickers'] = function()
|
||||||
return {
|
return {
|
||||||
new = function(opts, picker_opts)
|
new = function()
|
||||||
return {
|
return {
|
||||||
find = function() end,
|
find = function() end,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue