Skip to content

Commit c4087ca

Browse files
committed
remove unusend encoding variable, fix styling
1 parent 5fc2ca0 commit c4087ca

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

lua/copilot/suggestion/init.lua

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,9 @@ local function apply_edit(range, new_lines, bufnr)
587587
local end_char = range["end"].character
588588

589589
local current_lines = vim.api.nvim_buf_get_lines(bufnr, start_line, end_line + 1, false)
590-
if #current_lines == 0 then return end
590+
if #current_lines == 0 then
591+
return
592+
end
591593

592594
local before = current_lines[1]:sub(1, start_char)
593595
local after = current_lines[#current_lines]:sub(end_char + 1)
@@ -668,16 +670,6 @@ function M.accept(modifier)
668670

669671
local bufnr = vim.api.nvim_get_current_buf()
670672

671-
-- only utf encodings are supported
672-
local encoding = vim.api.nvim_get_option_value("fileencoding", { buf = bufnr })
673-
if not encoding or encoding == "" or encoding ~= "utf-8" or encoding ~= "utf-16" or encoding ~= "utf-32" then
674-
encoding = vim.api.nvim_get_option_value("encoding", { scope = "global" })
675-
676-
if not encoding or encoding == "" or encoding ~= "utf-8" or encoding ~= "utf-16" or encoding ~= "utf-32" then
677-
encoding = "utf-8"
678-
end
679-
end
680-
681673
local lines = vim.split(newText, "\n", { plain = true })
682674
local lines_count = #lines
683675
local last_col = #lines[lines_count]

0 commit comments

Comments
 (0)