fix: resolve LSP sync error when setting buffer lines (#2290)
This commit is contained in:
@@ -161,7 +161,7 @@ function Selection:submit_input(input)
|
|||||||
response_lines[i] = original_first_line_indentation .. line
|
response_lines[i] = original_first_line_indentation .. line
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
api.nvim_buf_set_lines(self.code_bufnr, start_line - 1, finish_line, true, response_lines)
|
pcall(function() api.nvim_buf_set_lines(self.code_bufnr, start_line - 1, finish_line, true, response_lines) end)
|
||||||
finish_line = start_line + #response_lines - 1
|
finish_line = start_line + #response_lines - 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -986,7 +986,7 @@ function M.get_chat_mentions()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function safe_open_file(filename)
|
local function safe_open_file(filename)
|
||||||
local ok, _ = pcall(vim.cmd, "noautocmd edit " .. filename)
|
local ok, _ = pcall(function() vim.cmd("noautocmd edit " .. filename) end)
|
||||||
if ok then
|
if ok then
|
||||||
-- Manually trigger necessary events
|
-- Manually trigger necessary events
|
||||||
vim.cmd("doautocmd BufRead")
|
vim.cmd("doautocmd BufRead")
|
||||||
|
|||||||
Reference in New Issue
Block a user