>From 9a5ac47e979de8030756b88d4e52b6d8a289a25a Mon Sep 17 00:00:00 2001
From: Mike Stipicevic <[email protected]>
Date: Mon, 16 Feb 2009 00:10:32 -0500
Subject: [PATCH] Added undo for delete thread
---
lib/sup/modes/thread-index-mode.rb | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/lib/sup/modes/thread-index-mode.rb
b/lib/sup/modes/thread-index-mode.rb
index ae7c299..159839d 100644
--- a/lib/sup/modes/thread-index-mode.rb
+++ b/lib/sup/modes/thread-index-mode.rb
@@ -443,11 +443,18 @@ EOS
multi_kill [t]
end
+ ## m-m-m-m-MULTI-KILL
def multi_kill threads
- threads.each do |t|
+ undo = threads.map do |t|
t.apply_label :killed
hide_thread t
+ thread = t
+ lambda { thread.remove_label :killed
+ add_or_unhide thread.first
+ }
end
+ UndoManager.register("killing #{threads.size} #{threads.size.pluralize
'thread'}",
+ undo << lambda {regen_text})
regen_text
BufferManager.flash "#{threads.size.pluralize 'Thread'} killed."
end
--
1.5.3
_______________________________________________
sup-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/sup-talk