Move to next todo item after marking one as done
This commit is contained in:
parent
9503962dd5
commit
b8fe625405
@ -50,6 +50,7 @@ impl TodoList {
|
||||
|
||||
pub fn toggle_current(&mut self) {
|
||||
self.todos[self.selected].done = !self.todos[self.selected].done;
|
||||
self.selected = (self.selected + 1).min(self.todos.len() - 1)
|
||||
}
|
||||
|
||||
fn current(&self) -> &Todo {
|
||||
|
Loading…
Reference in New Issue
Block a user