Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc10b7c0

Browse files
author
Zibi Braniecki
committed
Migrate to non-color format
1 parentfe63d9e commitc10b7c0

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

‎src/format.rs‎

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,25 @@ impl DisplayListFormatting for Formatter {
9191
}else{
9292
"".to_string()
9393
};
94-
writeln!(
95-
f,
96-
"{}{}{}",
97-
prefix,
98-
name,
99-
format!(": {}",Self::format_label(label))
100-
)
94+
ifletSome((first, rest)) =Self::format_label(label)
95+
.lines()
96+
.collect::<Vec<&str>>()
97+
.split_first()
98+
{
99+
let indent = prefix.len() + name.len() +2;
100+
writeln!(
101+
f,
102+
"{}{}{}",
103+
prefix,
104+
name,
105+
format!(": {}", first)
106+
)?;
107+
for linein rest{
108+
writeln!(f,"{}{}"," ".repeat(indent), format!("{}", line))?;
109+
}
110+
}
111+
Ok(())
112+
101113
}
102114
DisplayLine::Origin{
103115
path,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp