1
0
mirror of https://github.com/jht5945/finding.git synced 2025-12-29 14:10:05 +08:00
This commit is contained in:
2020-05-02 00:23:17 +08:00
parent e430e037bc
commit 1cbeccfd9a

View File

@@ -114,11 +114,11 @@ fn match_lines(tag: &str, content: &str, options: &Options) -> bool {
println!("{}", match_line.line_string); println!("{}", match_line.line_string);
} else { } else {
let ss: Vec<&str> = match_line.line_string.split(search_text).collect(); let ss: Vec<&str> = match_line.line_string.split(search_text).collect();
for j in 0..ss.len() { for (j, part) in ss.iter().enumerate() {
if j != 0 { if j != 0 {
print_color(Some(term::color::RED), true, search_text); print_color(Some(term::color::RED), true, search_text);
} }
print!("{}", ss[j]); print!("{}", part);
} }
println!(); println!();
} }