From 57ac41ff7267ca3d8a0424ddb895c0626f4bf935 Mon Sep 17 00:00:00 2001 From: Paolo Donadeo Date: Tue, 25 Nov 2025 00:40:16 +0100 Subject: [PATCH] fix(parser): correct priority calculation for 'Z' to return 0 Previously, the priority calculation did not handle 'Z' correctly, resulting in a non-zero value. Now, 'Z' returns 0 as intended, and the step size is calculated for a linear scale. --- internal/parser/parser.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/parser/parser.go b/internal/parser/parser.go index f76309f..fa84922 100644 --- a/internal/parser/parser.go +++ b/internal/parser/parser.go @@ -35,8 +35,12 @@ func (t Task) PriorityAsRemind() int { if p < 'A' || p > 'Z' { return 5000 } - // A=9999, Z=0, linear scale - return 9999 - int(p-'A')*400 + step := 9999 / 25 // 399 + val := 9999 - int(p-'A')*step + if p == 'Z' { + return 0 + } + return val } func (t Task) MarshalJSON() ([]byte, error) {