- if hl.empty?
- undo = threads.map do |t|
- old_labels = t.labels
- user_labels.each do |(l, to_remove)|
- if to_remove
- t.remove_label l
- else
- t.apply_label l
- end
- end
- ## UpdateManager or some other regresh mechanism?
- UpdateManager.relay self, :labeled, t.first
- lambda do
- t.labels = old_labels
- UpdateManager.relay self, :labeled, t.first
+ unless hl.empty?
+ BufferManager.flash "'#{hl}' is a reserved label!"
+ return
+ end
+
+ old_labels = threads.map { |t| t.labels.dup }
+
+ threads.each do |t|
+ user_labels.each do |(l, to_remove)|
+ if to_remove
+ t.remove_label l
+ else
+ t.apply_label l