aboutsummaryrefslogtreecommitdiff
path: root/helix-lsp/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-lsp/src/lib.rs')
-rw-r--r--helix-lsp/src/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/helix-lsp/src/lib.rs b/helix-lsp/src/lib.rs
index 0d04b711..3e4f55ea 100644
--- a/helix-lsp/src/lib.rs
+++ b/helix-lsp/src/lib.rs
@@ -35,7 +35,7 @@ pub mod util {
pub fn lsp_pos_to_pos(doc: RopeSlice, pos: lsp::Position) -> usize {
let line = doc.line_to_char(pos.line as usize);
let line_start = doc.char_to_utf16_cu(line);
- doc.utf16_cu_to_char(pos.character as usize + line_start)
+ doc.utf16_cu_to_char(line_start + pos.character as usize)
}
pub fn pos_to_lsp_pos(doc: RopeSlice, pos: usize) -> lsp::Position {
let line = doc.char_to_line(pos);