Skip to content

Commit

Permalink
fix: unwrap that could panic in visual_offset_from_anchor
Browse files Browse the repository at this point in the history
  • Loading branch information
poliorcetics committed Feb 21, 2023
1 parent 3630246 commit 4d3ef39
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion helix-core/src/position.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ pub fn visual_offset_from_anchor(
anchor_line = Some(last_pos.row);
}
if char_pos > pos {
last_pos.row -= anchor_line.unwrap();
last_pos.row -= anchor_line?;
return Some((last_pos, block_start));
}

Expand Down

0 comments on commit 4d3ef39

Please sign in to comment.