Stop after first match is found with --quiet.

Fixes #77.
This commit is contained in:
Andrew Gallant
2016-09-25 15:01:27 -04:00
parent 95edcd4d3a
commit 9dc5464c84
6 changed files with 13 additions and 4 deletions

View File

@@ -104,7 +104,7 @@ impl<'a, W: Send + Terminal> BufferSearcher<'a, W> {
self.print_match(m.start(), m.end());
}
last_end = m.end();
if self.opts.files_with_matches {
if self.printer.is_quiet() || self.opts.files_with_matches {
break;
}
}