Sha256: 307c9ba59efc6a071c4e8e279eff30fbb01282b4167b41f9bc73038c14145c22

Contents?: true

Size: 743 Bytes

Versions: 3

Compression:

Stored size: 743 Bytes

Contents

module Redwood

class LabelSearchResultsMode < ThreadIndexMode
  register_keymap do |k|
    k.add :load_more_threads, "Load #{LOAD_MORE_THREAD_NUM} more threads", 'M'
  end

  def initialize labels
    @labels = labels
    super
  end

  def is_relevant? m; @labels.all? { |l| m.has_label? l }; end

  def load_more_threads n=ThreadIndexMode::LOAD_MORE_THREAD_NUM
    load_n_threads_background n, :labels => @labels,
                                 :load_killed => true,
                                 :load_spam => false,
                                 :when_done =>(lambda do |num|
      if num > 0
        BufferManager.flash "Found #{num} threads"
      else
        BufferManager.flash "No matches"
      end
    end)
  end
end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sup-0.0.2 lib/sup/modes/label-search-results-mode.rb
sup-0.0.3 lib/sup/modes/label-search-results-mode.rb
sup-0.0.1 lib/sup/modes/label-search-results-mode.rb