From c860b46baabe2b2956307a4cd0fdd35a66f6f997 Mon Sep 17 00:00:00 2001 From: Dianne Skoll Date: Wed, 28 Aug 2024 12:52:07 -0400 Subject: [PATCH] Collapse multiple runs of whitespace --- scripts/tkremind | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/tkremind b/scripts/tkremind index 8d005903..22ee3eae 100755 --- a/scripts/tkremind +++ b/scripts/tkremind @@ -1217,6 +1217,13 @@ proc FillCalWindow {} { continue } .cal.t$n configure -state normal + + # Canonicalize spaces and newlines + set stuff [regsub -all {[ \t]+} $stuff " "] + set stuff [regsub -all {[ \t]+\n} $stuff "\n"] + set stuff [regsub -all {\n[ \t]} $stuff "\n"] + set stuff [regsub -all {\n+} $stuff "\n"] + if {[regexp {TKTAG([0-9]+)} $tag all tagno] && "$fntag" != "x"} { .cal.t$n insert end [string trim $stuff] [list REM TAGGED "TKTAG$tagno" "date_$date" $extratags $fntag] .cal.t$n tag bind "TKTAG$tagno" "TaggedEnter .cal.t$n"