From 2969e72454fe02212291828d156c19e6f8fd8a0b Mon Sep 17 00:00:00 2001 From: Mike Stipicevic 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 file changed, 8 insertions(+), 1 deletion(-) 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 -- 2.45.2