diff options
Diffstat (limited to 'src/search_buffer.rs')
-rw-r--r-- | src/search_buffer.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/search_buffer.rs b/src/search_buffer.rs index efc66cd7..6a32a631 100644 --- a/src/search_buffer.rs +++ b/src/search_buffer.rs @@ -81,6 +81,13 @@ impl<'a, W: Send + Terminal> BufferSearcher<'a, W> { self } + /// If enabled, don't show any output and quit searching after the first + /// match is found. + pub fn quiet(mut self, yes: bool) -> Self { + self.opts.quiet = yes; + self + } + /// If enabled, search binary files as if they were text. pub fn text(mut self, yes: bool) -> Self { self.opts.text = yes; @@ -104,7 +111,7 @@ impl<'a, W: Send + Terminal> BufferSearcher<'a, W> { self.print_match(m.start(), m.end()); } last_end = m.end(); - if self.printer.is_quiet() || self.opts.files_with_matches { + if self.opts.stop_after_first_match() { break; } } |