forked from janek/mostr
fix(main): only parse single-digit view depths
This commit is contained in:
parent
bdb8b6e814
commit
74fff5a2b1
|
@ -686,15 +686,20 @@ async fn main() -> Result<()> {
|
||||||
} else {
|
} else {
|
||||||
tasks.clear_filters();
|
tasks.clear_filters();
|
||||||
}
|
}
|
||||||
} else if let Ok(depth) = remaining.parse::<usize>() {
|
} else {
|
||||||
|
match remaining.parse::<usize>() {
|
||||||
|
Ok(depth) if depth < 10 => {
|
||||||
if pos != tasks.get_position_ref() {
|
if pos != tasks.get_position_ref() {
|
||||||
tasks.move_to(pos.cloned());
|
tasks.move_to(pos.cloned());
|
||||||
}
|
}
|
||||||
tasks.set_view_depth(depth);
|
tasks.set_view_depth(depth);
|
||||||
} else {
|
}
|
||||||
|
_ => {
|
||||||
tasks.filter_or_create(pos.cloned().as_ref(), &remaining).map(|id| tasks.move_to(Some(id)));
|
tasks.filter_or_create(pos.cloned().as_ref(), &remaining).map(|id| tasks.move_to(Some(id)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Some('/') => if arg.is_none() {
|
Some('/') => if arg.is_none() {
|
||||||
tasks.move_to(None);
|
tasks.move_to(None);
|
||||||
|
|
Loading…
Reference in New Issue