Sha256: 39cb3f44183063eae31bfaf10341a357d981842e51eecc6b1b157ca20d98725a

Contents?: true

Size: 833 Bytes

Versions: 2

Compression:

Stored size: 833 Bytes

Contents

module Redwood

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

  def initialize content
    raise ArgumentError, "no content" if content =~ /^\s*$/
    @content = content.gsub(/[\(\)]/) { |x| "\\" + x }
    super
  end

  ## TODO: think about this
  def is_relevant? m; super; end

  def load_more_threads n=ThreadIndexMode::LOAD_MORE_THREAD_NUM
    load_n_threads_background n, :content => @content,
                                 :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

2 entries across 2 versions & 1 rubygems

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