Skip to content

Commit 997e12c

Browse files
committed
disable respace
1 parent d352aeb commit 997e12c

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/util.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,13 @@ pub fn sanitize_keyword(sc: Cow<str>) -> Cow<str> {
148148
}
149149

150150
pub fn respace(s: &str) -> String {
151-
s.split_whitespace()
152-
.collect::<Vec<_>>()
153-
.join(" ")
154-
.replace(r"\n", "\n")
151+
let s = if s.matches("\n").count() == 1 {
152+
// Special case for STM32
153+
s.split_whitespace().collect::<Vec<_>>().join(" ")
154+
} else {
155+
s.into()
156+
};
157+
s.replace(r"\n", "\n")
155158
}
156159

157160
pub fn escape_brackets(s: &str) -> String {

0 commit comments

Comments
 (0)