Skip to content

Commit

Permalink
feat(copilot.vim): fixes repeat command to repeating completed Copilo…
Browse files Browse the repository at this point in the history
…t suggestions

This commit changes the key sequence in the Accept function from
Control-R Control-O to Control-R Control-R. The change
results in the `.` register being set when executed and thus allows the repeat command to chain Copilot completions.
  • Loading branch information
shaunemslie committed May 30, 2024
1 parent c79d711 commit c62e576
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion autoload/copilot.vim
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ function! copilot#Accept(...) abort
call s:ClearPreview()
let s:suggestion_text = text
return repeat("\<Left>\<Del>", s.outdentSize) . repeat("\<Del>", s.deleteSize) .
\ "\<C-R>\<C-O>=copilot#TextQueuedForInsertion()\<CR>" . (a:0 > 1 ? '' : "\<End>")
\ "\<C-R>\<C-R>=copilot#TextQueuedForInsertion()\<CR>" . (a:0 > 1 ? '' : "\<End>")
endif
let default = get(g:, 'copilot_tab_fallback', pumvisible() ? "\<C-N>" : "\t")
if !a:0
Expand Down

0 comments on commit c62e576

Please sign in to comment.