Skip to content

Commit

Permalink
Fix rule index (off-by-one errors go brrr)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThePuzzlemaker committed Oct 1, 2021
1 parent 8adb2bb commit b642d18
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ impl Editor {
fn display_status(&self) {
let status = match &self.state {
| State::Editing(msg, _) => msg.clone(),
| _ => format!("{} (rule {}/{})", DEFAULT_STATUS, self.rule_idx, self.rules.len()),
| _ => format!("{} (rule {}/{})", DEFAULT_STATUS, self.rule_idx + 1, self.rules.len()),
};
let width = usize::from(self.terminal.width());
println!("{0: ^1$}\r", status, width);
Expand Down

0 comments on commit b642d18

Please sign in to comment.