Skip to content

Commit

Permalink
Merge pull request #18 from Etto48/fix/underflow_with_no_file_open
Browse files Browse the repository at this point in the history
fixed a stupid error that made the address variable underflow when no file was open
  • Loading branch information
Etto48 authored Apr 4, 2024
2 parents 6d3db6f + 8aedbd9 commit d0fea4b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/cursor_position.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ impl <'a> App<'a>
}
if address >= self.data.len()
{
address = self.data.len() - 1;
address = self.data.len().saturating_sub(1);
}

let expected_cursor_position = self.get_expected_cursor_position(address, false);
Expand Down

0 comments on commit d0fea4b

Please sign in to comment.