-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to scroll list by count? #569
Labels
feature
New feature or request
Comments
quick workaround local function select_next_idx(idx, dir)
dir = dir or 1
local list = require "blink.cmp.completion.list"
if #list.items == 0 then
return
end
local target_idx
-- haven't selected anything yet
if list.selected_item_idx == nil then
if dir == 1 then
target_idx = idx
else
target_idx = #list.items - idx
end
elseif list.selected_item_idx == #list.items then
if dir == 1 then
target_idx = 1
else
target_idx = #list.items - idx
end
elseif list.selected_item_idx == 1 and dir == -1 then
target_idx = #list.items - idx
else
target_idx = list.selected_item_idx + (idx * dir)
end
-- clamp
if target_idx < 1 then
target_idx = 1
elseif target_idx > #list.items then
target_idx = #list.items
end
list.select(target_idx)
end keymap = {
["<PageDown>"] = {
function(cmp)
if not cmp.is_visible() then
return
end
vim.schedule(function()
select_next_idx(3)
end)
return true
end,
"fallback",
},
["<PageUp>"] = {
function(cmp)
if not cmp.is_visible() then
return
end
vim.schedule(function()
select_next_idx(3, -1)
end)
return true
end,
"fallback",
},
} |
Would you expect this to respect |
I'm not sure, either way is fine, your call :-) |
I believe the more sane default would be to respect it, but maybe it could be a setup parameter? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Feature Description
Ty @Saghen for this wonderful plugin!
I might be missing something but I also looked at the code and couldn't find an equivalent for documentation scroll up|down for the item list.
The use case is using
<C-b>|<C-f>
to scroll the item list back/forward, perhaps something like #382 but forselect_{next|prev}
?The text was updated successfully, but these errors were encountered: