9 def tagged? o; @tagged[o]; end
10 def toggle_tag_for o; @tagged[o] = !@tagged[o]; end
11 def drop_all_tags; @tagged.clear; end
12 def drop_tag_for o; @tagged.delete o; end
15 num_tagged = @tagged.map { |t| t ? 1 : 0 }.sum
17 BufferManager.flash "No tagged messages!"
21 noun = num_tagged == 1 ? "message" : "messages"
22 c = BufferManager.ask_getch "apply to #{num_tagged} tagged #{noun}:"
23 return if c.nil? # user cancelled
25 if(action = @mode.resolve_input c)
26 tagged_sym = "multi_#{action}".intern
27 if @mode.respond_to? tagged_sym
28 targets = @tagged.select_by_value
29 @mode.send tagged_sym, targets
31 BufferManager.flash "That command cannot be applied to multiple messages."
34 BufferManager.flash "Unknown command #{c.to_character}."