You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use Copilot in a 'super-tab' fashion like this:
local keys = {
['tab'] = vim.api.nvim_replace_termcodes('<Tab>', true, true, true),
['ctrl-y'] = vim.api.nvim_replace_termcodes('<C-y>', true, true, true),
['ctrl-tab'] = vim.api.nvim_replace_termcodes('<C-Tab>', true, true, true),
}
_G.tab_action = function()
if vim.fn.pumvisible() ~= 0 then
return keys['ctrl-y']
elseif require("copilot.suggestion").is_visible() then
require("copilot.suggestion").accept()
return
else
return keys['tab']
end
end
vim.keymap.set('i', '<Tab>', 'v:lua._G.tab_action()', { expr = true })
However, whenever I try to use tab to fill in a suggestion I get the following Neovim here:
E5108: Error executing lua /usr/share/nvim/runtime/lua/vim/lsp/util.lua:515: E565: Not allowed to change text or change window
stack traceback:
[C]: in function 'nvim_buf_set_text'
/usr/share/nvim/runtime/lua/vim/lsp/util.lua:515: in function 'apply_text_edits'
...ite/pack/deps/opt/copilot.lua/lua/copilot/suggestion.lua:487: in function 'accept'
/home/louis/git/dotfiles/config/nvim/init.lua:503: in function </home/louis/git/dotfiles/config/nvim/init.lua:499>
The text was updated successfully, but these errors were encountered:
Same here. I'm using neovim 0.9.4,.
It only happens when using require("copilot.suggestion").accept, if I use require("copilot.suggestion").accept_word it works.
Here's a stack trace:
E5108: Error executing lua: ...-unwrapped-0.9.4/share/nvim/runtime/lua/vim/lsp/util.lua:501: Failed to save undo information
stack traceback:
[C]: in function 'nvim_buf_set_text'
...-unwrapped-0.9.4/share/nvim/runtime/lua/vim/lsp/util.lua:501: in function 'apply_text_edits'
...l/share/nvim/lazy/copilot.lua/lua/copilot/suggestion.lua:487: in function 'accept'
/home/vini/.config/nvim/lua/plugins/coding.lua:10: in function </home/vini/.config/nvim/lua/plugins/coding.lua:8>
Hello.
I'm trying to use Copilot in a 'super-tab' fashion like this:
However, whenever I try to use tab to fill in a suggestion I get the following Neovim here:
The text was updated successfully, but these errors were encountered: