Skip to content

Errors accepting suggestions with latin1 encoded files #458

Closed
@higorhgoncalves

Description

@higorhgoncalves

I am having errors when accepting suggestions in latin1 encoded files.

Error executing vim.schedule lua callback: vim/_editor.lua:0: encoding: expected ?, got latin1. Info: invalid encoding
stack traceback:
[C]: in function 'error'
vim/shared.lua: in function 'validate'
vim/_editor.lua: in function 'get_line_byte_from_position'
/usr/share/nvim/runtime/lua/vim/lsp/util.lua:356: in function 'apply_text_edits'
...re/nvim/lazy/copilot.lua/lua/copilot/suggestion/init.lua:542: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>

this is my config:

{
	"zbirenbaum/copilot.lua",
	cmd = "Copilot",
	event = "InsertEnter",
	config = function()

		require("copilot").setup({
			panel = {
				enabled = false,
			},
			suggestion = {
				enabled = true,
				auto_trigger = true,
				hide_during_completion = true,
				debounce = 75,
				trigger_on_accept = true,
				keymap = {
					accept = "<M-l>",
					accept_word = "<M-Right>",
					accept_line = "<M-C-Right>",
					next = "<M-]>",
					prev = "<M-[>",
					dismiss = "<C-]>",
				},
			},
			copilot_model = "gpt-4o-copilot",
		})
	end,
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingquestionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions