From 2e3a4747e2001fbee0af6b4d6e2099fe68c61e45 Mon Sep 17 00:00:00 2001 From: black_desk Date: Tue, 5 Oct 2021 07:03:55 +0800 Subject: fix(lsp): default to UTF-16 in make_position_params --- runtime/lua/vim/lsp/util.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'runtime/lua/vim') diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua index 7a0ac458f3..319634a390 100644 --- a/runtime/lua/vim/lsp/util.lua +++ b/runtime/lua/vim/lsp/util.lua @@ -1788,7 +1788,9 @@ local function make_position_param() if not line then return { line = 0; character = 0; } end - col = str_utfindex(line, col) + -- TODO handle offset_encoding + local _ + _, col = str_utfindex(line, col) return { line = row; character = col; } end -- cgit