Fix encoding translation in other places.

This commit is contained in:
Ashkan Kiani
2019-11-21 16:23:12 -08:00
parent c055ca00ce
commit a3d67dac5f
3 changed files with 24 additions and 7 deletions

View File

@@ -649,6 +649,13 @@ function M.make_position_params()
}
end
-- @param buf buffer handle or 0 for current.
-- @param row 0-indexed line
-- @param col 0-indexed byte offset in line
function M.character_offset(buf, row, col)
local line = api.nvim_buf_get_lines(buf, row, row+1, true)[1]
return vim.str_utfindex(line, col)
end
return M
-- vim:sw=2 ts=2 et