From: Mike Stipicevic Date: Mon, 16 Feb 2009 05:10:32 +0000 (-0500) Subject: Added undo for delete thread X-Git-Url: https://git.notmuchmail.org/git?a=commitdiff_plain;h=2969e72454fe02212291828d156c19e6f8fd8a0b;p=sup Added undo for delete thread --- 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