end
Thread.abort_on_exception = true # make debugging possible
+Thread.current.priority = 1 # keep ui responsive
module Redwood
end
if $opts[:search]
- SearchResultsMode.spawn_from_query $opts[:search]
+ SearchResultsMode.spawn_from_query $opts[:search], true
end
until Redwood::exceptions.nonempty? || $die
c = begin
Ncurses.nonblocking_getch
- rescue Interrupt => e
+ rescue Interrupt
raise if BufferManager.ask_yes_or_no "Die ungracefully now?"
BufferManager.draw_screen
nil
when :search
query = BufferManager.ask :search, "search all messages: "
next unless query && query !~ /^\s*$/
- SearchResultsMode.spawn_from_query query
+ SearchResultsMode.spawn_from_query query, true
when :search_unread
- SearchResultsMode.spawn_from_query "is:unread"
+ SearchResultsMode.spawn_from_query "is:unread", InboxMode.newest_first
when :list_labels
labels = LabelManager.all_labels.map { |l| LabelManager.string_for l }
user_label = bm.ask_with_completions :label, "Show threads with label (enter for listing): ", labels