about summary refs log tree commit homepage
path: root/lib/PublicInbox/SearchView.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/SearchView.pm')
-rw-r--r--lib/PublicInbox/SearchView.pm10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/PublicInbox/SearchView.pm b/lib/PublicInbox/SearchView.pm
index f1c4b6a0..cec87c6a 100644
--- a/lib/PublicInbox/SearchView.pm
+++ b/lib/PublicInbox/SearchView.pm
@@ -145,7 +145,7 @@ sub search_nav_bot {
         my $o = $q->{o};
         my $end = $o + $nr;
         my $beg = $o + 1;
-        my $rv = '</pre><hr><pre>';
+        my $rv = '</pre><hr><pre id=t>';
         if ($beg <= $end) {
                 $rv .= "Results $beg-$end of $total";
                 $rv .= ' (estimated)' if $end != $total;
@@ -185,9 +185,9 @@ sub mset_thread {
                 $pct{$smsg->mid} = $i->get_percent;
                 $smsg;
         } ($mset->items) ]});
-
+        my $r = $q->{r};
         my $rootset = PublicInbox::SearchThread::thread($msgs,
-                $q->{r} ? sort_relevance(\%pct) : *PublicInbox::View::sort_ts);
+                $r ? sort_relevance(\%pct) : *PublicInbox::View::sort_ts);
         my $skel = search_nav_bot($mset, $q). "<pre>";
         my $inbox = $ctx->{-inbox};
         $ctx->{-upfx} = '';
@@ -203,11 +203,11 @@ sub mset_thread {
 
         PublicInbox::View::walk_thread($rootset, $ctx,
                 *PublicInbox::View::pre_thread);
-
+        @$msgs = reverse @$msgs if $r;
         my $mime;
         sub {
                 return unless $msgs;
-                while ($mime = shift @$msgs) {
+                while ($mime = pop @$msgs) {
                         $mime = $inbox->msg_by_smsg($mime) and last;
                 }
                 if ($mime) {