aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/util.lua
diff options
context:
space:
mode:
authorAndreas Johansson <andreas@ndrs.xyz>2020-05-19 08:50:31 +0200
committerAndreas Johansson <andreas@ndrs.xyz>2020-05-19 08:50:31 +0200
commit0aca34e0a98ab47a8ae907031b25f687760a9264 (patch)
tree23a99a0cd6330b83ee9f0c75d51aa50e41deeb84 /runtime/lua/vim/lsp/util.lua
parent131063e08fef32ee34732ba1530676bdf408d924 (diff)
downloadrneovim-0aca34e0a98ab47a8ae907031b25f687760a9264.tar.gz
rneovim-0aca34e0a98ab47a8ae907031b25f687760a9264.tar.bz2
rneovim-0aca34e0a98ab47a8ae907031b25f687760a9264.zip
Use get_line_byte_from_position in jump_to_location
Diffstat (limited to 'runtime/lua/vim/lsp/util.lua')
-rw-r--r--runtime/lua/vim/lsp/util.lua4
1 files changed, 1 insertions, 3 deletions
diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua
index 8a536f72f4..1b099fb3f4 100644
--- a/runtime/lua/vim/lsp/util.lua
+++ b/runtime/lua/vim/lsp/util.lua
@@ -474,9 +474,7 @@ function M.jump_to_location(location)
api.nvim_buf_set_option(0, 'buflisted', true)
local range = location.range or location.targetSelectionRange
local row = range.start.line
- local col = range.start.character
- local line = api.nvim_buf_get_lines(0, row, row+1, true)[1]
- col = vim.str_byteindex(line, col)
+ local col = get_line_byte_from_position(0, range.start)
api.nvim_win_set_cursor(0, {row + 1, col})
return true
end