From: Ian Jackson Date: Sun, 3 Oct 2010 23:40:23 +0000 (+0100) Subject: ypp-chatlog-alerter: when replacing, always delete the row and shuffle others up X-Git-Tag: 6.7.0~6 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.db-live.git;a=commitdiff_plain;h=3a1a8810c86564e4831d4d5bf468c00af2278b87 ypp-chatlog-alerter: when replacing, always delete the row and shuffle others up --- diff --git a/ypp-chatlog-alerter b/ypp-chatlog-alerter index fb6bba7..2f6d86e 100755 --- a/ypp-chatlog-alerter +++ b/ypp-chatlog-alerter @@ -270,7 +270,7 @@ puts "MESSAGE $l" } proc message {pirate msg} { - global times pirates messages + global times pirates messages height global lw_ls lw_ws set ix [lsearch -exact $pirates $pirate] @@ -285,6 +285,13 @@ proc message {pirate msg} { } incr cix } + for_lw { + set $l [lreplace [set $l] $ix $ix] + lappend $l {} + $w delete $ix + $w insert end {} + } + set ix [expr {$height-1}] } for_lw new [list $now $pirate $msg] { set $l [lreplace [set $l] $ix $ix $new]