From a3a732879fff5f8f903afe585bccccc28cc6c00a Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Thu, 8 Aug 2024 13:04:52 +0300 Subject: [PATCH] feat(tasks): don't create tasks from typos --- src/tasks.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tasks.rs b/src/tasks.rs index f71c7be..8996095 100644 --- a/src/tasks.rs +++ b/src/tasks.rs @@ -429,7 +429,12 @@ impl Tasks { 0 => { // No match, new task self.view.clear(); - Some(self.make_task(arg)) + if arg.len() > 2 { + Some(self.make_task(arg)) + } else { + warn!("Not creating task under 3 chars to avoid silly mistakes"); + None + } } 1 => { // One match, activate