From 74fff5a2b140787e66af482a803fb0d04bb853aa Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Tue, 15 Oct 2024 03:28:40 +0200 Subject: [PATCH] fix(main): only parse single-digit view depths --- src/main.rs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index 94bed63..afb008e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -686,13 +686,18 @@ async fn main() -> Result<()> { } else { tasks.clear_filters(); } - } else if let Ok(depth) = remaining.parse::() { - if pos != tasks.get_position_ref() { - tasks.move_to(pos.cloned()); - } - tasks.set_view_depth(depth); } else { - tasks.filter_or_create(pos.cloned().as_ref(), &remaining).map(|id| tasks.move_to(Some(id))); + match remaining.parse::() { + Ok(depth) if depth < 10 => { + if pos != tasks.get_position_ref() { + tasks.move_to(pos.cloned()); + } + tasks.set_view_depth(depth); + } + _ => { + tasks.filter_or_create(pos.cloned().as_ref(), &remaining).map(|id| tasks.move_to(Some(id))); + } + } } }