1
0
mirror of https://github.com/BurntSushi/ripgrep.git synced 2025-06-30 22:23:44 +02:00

Hack in Windows console coloring.

The code has suffered and needs refactoring/commenting. BUT... IT WORKS!
This commit is contained in:
Andrew Gallant
2016-09-07 21:54:28 -04:00
parent ca058d7584
commit 0042dce949
6 changed files with 215 additions and 31 deletions

View File

@ -35,6 +35,7 @@ use std::thread;
use crossbeam::sync::chase_lev::{self, Steal, Stealer};
use grep::Grep;
use memmap::{Mmap, Protection};
use term::Terminal;
use walkdir::DirEntry;
use args::Args;
@ -198,11 +199,11 @@ impl Worker {
let mut printer = self.args.printer(outbuf);
self.do_work(&mut printer, work);
let outbuf = printer.into_inner();
if !outbuf.is_empty() {
if !outbuf.get_ref().is_empty() {
let mut out = self.out.lock().unwrap();
out.write(&outbuf);
}
self.outbuf = Some(outbuf);
self.outbuf = Some(outbuf.into_inner());
}
self.match_count
}