-
Notifications
You must be signed in to change notification settings - Fork 65
Closed
Description
I've been trying out augment completion and loved it much more than copilot. However, sometimes i want to be able to accept only a point. For this, I need something like copilot#GetDisplayedSuggestion.
Example
This is what i have to make copilot.vim accept until some char
local function highlight_jump_accept()
local char = vim.fn.nr2char(vim.fn.getchar())
local suggestion = vim.fn['copilot#GetDisplayedSuggestion']()
local text = suggestion.text
assert(suggestion, 'copilot#GetDisplayedSuggestion not found')
assert(text, 'suggestion text not found')
local matches = parse_suggestion(text, char)
if #matches == 0 then
return
end
if #matches == 1 then
local partial = string.sub(text, 1, matches[1])
vim.api.nvim_feedkeys(partial, 'n', false)
return
end
local labels, ns = hightlight_label_for_jump(matches, text)
jump_from_user_choice(labels, ns, text)
endReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels