on master help sign in
dap: Fix an off-by-one error when jumping
commite98993d609cfa64dd0b48b808582a220010a9101 authorBlaž Hrastnik <blaz@mxxn.io> dateWed 8 Dec 2021, 00:22 (5 years ago) parentbf8437d
1 file changed+1−1
helix-term/src/commands/dap.rs+1−1
helix-term/src/commands/dap.rs+1−1
@@ -25,7 +25,7 @@ use anyhow::{anyhow, bail};
2525pub fn dap_pos_to_pos(doc: &helix_core::Rope, line: usize, column: usize) -> Option<usize> {
2626 // 1-indexing to 0 indexing
2727 let line = doc.try_line_to_char(line - 1).ok()?;
28− let pos = line + column;
28+ let pos = line + column.saturating_sub(1);
2929 // TODO: this is probably utf-16 offsets
3030 Some(pos)
3131}