summaryrefslogtreecommitdiff
path: root/helix-term
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-12-07 15:22:48 +0000
committerBlaž Hrastnik2021-12-07 15:22:48 +0000
commite98993d609cfa64dd0b48b808582a220010a9101 (patch)
tree9429daef5a5205a8019488586ccae4aaaf0c4ce8 /helix-term
parentbf8437d098433c25e3eae1291f444130068ef93d (diff)
dap: Fix an off-by-one error when jumping
Diffstat (limited to 'helix-term')
-rw-r--r--helix-term/src/commands/dap.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/helix-term/src/commands/dap.rs b/helix-term/src/commands/dap.rs
index 5ed9d04f..f2a43f8b 100644
--- a/helix-term/src/commands/dap.rs
+++ b/helix-term/src/commands/dap.rs
@@ -25,7 +25,7 @@ use anyhow::{anyhow, bail};
pub fn dap_pos_to_pos(doc: &helix_core::Rope, line: usize, column: usize) -> Option<usize> {
// 1-indexing to 0 indexing
let line = doc.try_line_to_char(line - 1).ok()?;
- let pos = line + column;
+ let pos = line + column.saturating_sub(1);
// TODO: this is probably utf-16 offsets
Some(pos)
}