chiark / gitweb /
ypp-chatlog-alerter: when replacing, always delete the row and shuffle others up
[ypp-sc-tools.main.git] / ypp-chatlog-alerter
index fb6bba79d8aae695356c5b96c9303ad0d8d6c086..2f6d86ef2fa934cd7659f472065445a8f15c51d6 100755 (executable)
@@ -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]