about summary refs log tree commit homepage
path: root/lib/PublicInbox/LeiQuery.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/LeiQuery.pm')
-rw-r--r--lib/PublicInbox/LeiQuery.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/PublicInbox/LeiQuery.pm b/lib/PublicInbox/LeiQuery.pm
index d637b1ae..f71beae6 100644
--- a/lib/PublicInbox/LeiQuery.pm
+++ b/lib/PublicInbox/LeiQuery.pm
@@ -14,7 +14,12 @@ sub prep_ext { # externals_each callback
 sub qstr_add { # for --stdin
         my ($self) = @_; # $_[1] = $rbuf
         if (defined($_[1])) {
-                return eval { $self->{lxs}->do_query($self) } if $_[1] eq '';
+                $_[1] eq '' and return eval {
+                        my $lse = delete $self->{lse};
+                        $lse->query_approxidate($lse->git,
+                                                $self->{mset_opt}->{qstr});
+                        $self->{lxs}->do_query($self);
+                };
                 $self->{mset_opt}->{qstr} .= $_[1];
         } else {
                 $self->fail("error reading stdin: $!");
@@ -105,6 +110,7 @@ sub lei_q {
 no query allowed on command-line with --stdin
 
                 require PublicInbox::InputPipe;
+                $self->{lse} = $lse; # for query_approxidate
                 PublicInbox::InputPipe::consume($self->{0}, \&qstr_add, $self);
                 return;
         }