Skip to content

Commit 899e93f

Browse files
authored
fix: use new 3-arg API for vim.str_utfindex (#333)
1 parent 7f9301e commit 899e93f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lua/null-ls/diff.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ function M.compute_diff(old_lines, new_lines, line_ending)
155155
adj_end_char = #old_lines[#old_lines + end_line + 1] + end_char + 1
156156
end
157157

158-
local _, adjusted_start_char = vim.str_utfindex(old_lines[start_line], start_char - 1)
159-
local _, adjusted_end_char = vim.str_utfindex(old_lines[#old_lines + end_line + 1], adj_end_char)
158+
local adjusted_start_char = vim.str_utfindex(old_lines[start_line], "utf-16", start_char - 1)
159+
local adjusted_end_char = vim.str_utfindex(old_lines[#old_lines + end_line + 1], "utf-16", adj_end_char)
160160
start_char = adjusted_start_char
161161
end_char = adjusted_end_char
162162

0 commit comments

Comments
 (0)