mirror of https://github.com/sharkdp/fd.git
Another small fix for the ANSI regex
This commit is contained in:
parent
75f1404c25
commit
b170396fc7
|
@ -148,7 +148,7 @@ fn parse_dircolors(path: &Path) -> std::io::Result<ExtensionStyles> {
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let pattern_ansi =
|
let pattern_ansi =
|
||||||
Regex::new(r"^\.([A-Za-z0-9]+)\s*(?:([0-9][0-9]);)?([0-9][0-9])\b")
|
Regex::new(r"^\.([A-Za-z0-9]+)\s*(?:([0-9]+);)?([0-9][0-9])\b")
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
for line in BufReader::new(file).lines() {
|
for line in BufReader::new(file).lines() {
|
||||||
|
@ -178,8 +178,11 @@ fn parse_dircolors(path: &Path) -> std::io::Result<ExtensionStyles> {
|
||||||
let style_s = caps.get(2)
|
let style_s = caps.get(2)
|
||||||
.map_or("", |m| m.as_str());
|
.map_or("", |m| m.as_str());
|
||||||
let style = match style_s {
|
let style = match style_s {
|
||||||
|
"1" => color.bold(),
|
||||||
"01" => color.bold(),
|
"01" => color.bold(),
|
||||||
|
"3" => color.italic(),
|
||||||
"03" => color.italic(),
|
"03" => color.italic(),
|
||||||
|
"4" => color.underline(),
|
||||||
"04" => color.underline(),
|
"04" => color.underline(),
|
||||||
_ => color.normal()
|
_ => color.normal()
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue