diff options
Diffstat (limited to 'helix-lsp/src/lib.rs')
-rw-r--r-- | helix-lsp/src/lib.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/helix-lsp/src/lib.rs b/helix-lsp/src/lib.rs index 27a5e046..97afbca0 100644 --- a/helix-lsp/src/lib.rs +++ b/helix-lsp/src/lib.rs @@ -37,7 +37,7 @@ pub mod util { } pub fn pos_to_lsp_pos(doc: &RopeSlice, pos: usize) -> lsp::Position { let line = doc.char_to_line(pos); - let line_start = doc.char_to_utf16_cu(line); + let line_start = doc.char_to_utf16_cu(doc.line_to_char(line)); let col = doc.char_to_utf16_cu(pos) - line_start; lsp::Position::new(line as u32, col as u32) |