commit 2969e72454fe02212291828d156c19e6f8fd8a0b
parent d1e423b103f64e30e271539041db11727ea2b6da
Author: Mike Stipicevic <stipim@rpi.edu>
Date: Mon, 16 Feb 2009 00:10:32 -0500
Added undo for delete thread
Diffstat:
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git 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