From 8d5223343b1f6acd20659fa7bc4557ab94366b28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=84min=20Baumeler?= Date: Wed, 28 May 2025 16:09:39 +0200 Subject: [PATCH] fix:repeated STATUS --- fzf-vjour | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fzf-vjour b/fzf-vjour index 3d2ad06..7b7b108 100755 --- a/fzf-vjour +++ b/fzf-vjour @@ -33,9 +33,10 @@ BEGIN { print "PRIORITY:" prio; # Print status (toggle if needed) + bit_status = status == "COMPLETED" ? 1 : 0; bit_toggle = delta ? 0 : 1; - percent = xor(completed, bit_toggle) ? 100 : 0; - status = xor(completed, bit_toggle) ? "COMPLETED" : "NEEDS-ACTION"; + percent = xor(bit_status, bit_toggle) ? 100 : 0; + status = xor(bit_status, bit_toggle) ? "COMPLETED" : "NEEDS-ACTION"; print "STATUS:" status print "PERCENT-COMPLETE:" percent @@ -48,7 +49,7 @@ BEGIN { /^SEQUENCE/ && inside { seq = 1; print "SEQUENCE:" $2+1; next } /^LAST-MODIFIED/ && inside { lm = 1; print "LAST-MODIFIED:" zulu; next } /^PRIORITY:/ && inside { prio = $2; next } -/^STATUS:COMPLETED/ && inside { completed = 1; next } +/^STATUS/ && inside { status = $2; next } /^PERCENT-COMPLETE/ && inside { next } # ignore, we take STATUS:COMPLETED as reference { print }'