Skip to content

Commit 0405b78

Browse files
committed
build: update deprecated apis
1 parent e569d1d commit 0405b78

5 files changed

Lines changed: 5 additions & 5 deletions

File tree

lua/avante/history/render.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ function M.get_diff_lines(old_str, new_str, decoration, truncate)
135135
local old_lines = vim.split(old_str, "\n")
136136
local new_lines = vim.split(new_str, "\n")
137137
---@diagnostic disable-next-line: assign-type-mismatch, missing-fields
138-
local patch = vim.diff(old_str, new_str, { ---@type integer[][]
138+
local patch = vim.text.diff(old_str, new_str, { ---@type integer[][]
139139
algorithm = "histogram",
140140
result_type = "indices",
141141
ctxlen = vim.o.scrolloff,

lua/avante/llm_tools/replace_in_file.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ Please make sure the diff is formatted correctly, and that the SEARCH/REPLACE bl
253253
local patch
254254
if Config.behaviour.minimize_diff then
255255
---@diagnostic disable-next-line: assign-type-mismatch, missing-fields
256-
patch = vim.diff(old_string, new_string, { ---@type integer[][]
256+
patch = vim.text.diff(old_string, new_string, { ---@type integer[][]
257257
algorithm = "histogram",
258258
result_type = "indices",
259259
ctxlen = vim.o.scrolloff,

lua/avante/sidebar.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,7 @@ local function minimize_snippet(original_lines, snippet)
901901
local snippet_content = snippet.content
902902
local snippet_lines = vim.split(snippet_content, "\n")
903903
---@diagnostic disable-next-line: assign-type-mismatch
904-
local patch = vim.diff( ---@type integer[][]
904+
local patch = vim.text.diff( ---@type integer[][]
905905
original_snippet_content,
906906
snippet_content,
907907
---@diagnostic disable-next-line: missing-fields

lua/avante/suggestion.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ function Suggestion:show()
305305
virt_text_win_col = #current_lines[start_row]
306306
lines[1] = string.sub(lines[1], #current_lines[start_row] + 1)
307307
else
308-
local patch = vim.diff(
308+
local patch = vim.text.diff(
309309
current_lines[start_row],
310310
lines[1],
311311
---@diagnostic disable-next-line: missing-fields

lua/avante/utils/init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1744,7 +1744,7 @@ function M.get_unified_diff(text1, text2, opts)
17441744
opts.result_type = "unified"
17451745
opts.ctxlen = opts.ctxlen or 3
17461746

1747-
return vim.diff(text1, text2, opts)
1747+
return vim.text.diff(text1, text2, opts)
17481748
end
17491749

17501750
function M.is_floating_window(win_id)

0 commit comments

Comments
 (0)