mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-16 06:18:47 +02:00
Renumber tags when we delete a tagged reminder.
This commit is contained in:
@@ -3024,6 +3024,7 @@ proc DeleteTaggedReminder { tag } {
|
||||
|
||||
set found 0
|
||||
|
||||
set tagno 0
|
||||
while {[gets $in line] >= 0} {
|
||||
if {[string match "REM TAG $tag *" $line]} {
|
||||
set found 1
|
||||
@@ -3039,7 +3040,14 @@ proc DeleteTaggedReminder { tag } {
|
||||
if {[string match "# TKEND" $line]} {
|
||||
continue
|
||||
}
|
||||
puts $out $line
|
||||
|
||||
# Renumber tags
|
||||
if {[regexp {^REM TAG TKTAG([0-9]+) (.*)$} $line all oldtag rest]} {
|
||||
incr tagno
|
||||
puts $out "REM TAG TKTAG$tagno $rest"
|
||||
} else {
|
||||
puts $out $line
|
||||
}
|
||||
}
|
||||
|
||||
if {! $found } {
|
||||
|
||||
Reference in New Issue
Block a user