Skip to content

Commit 2d2dc9e

Browse files
committed
Use saturating sub
fixes #58 ?
1 parent bcbcf5c commit 2d2dc9e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/app.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ impl App {
742742
// populate inline variables with values
743743
let mut vars = vec![];
744744
if let Some(analysis) = analysis {
745-
for (_, var) in analysis.row(line_no as usize - 1) {
745+
for (_, var) in analysis.row((line_no as usize).saturating_sub(1)) {
746746
let property = stack.get_property(var.name.as_str());
747747
if let Some(property) = property {
748748
vars.push(Variable{ var_ref: var, value: property.clone() });

0 commit comments

Comments
 (0)