fix/reflow: iterator lengths did not match
@@ -104,15 +104,12 @@ fn reflow_inner<'s>(
};
let mut reflow_applied = false;
-
+ let mut lines = s_absolute.lines();
let mut pre = prefix.iter();
// construct replacement string from prefix and Gluon iterations
- let acc =
- gluon
- .zip(s_absolute.lines())
- .fold(String::new(), |mut acc, ((_, content, _), line)| {
- if line != &content {
+ let acc = gluon.fold(String::new(), |mut acc, (_, content, _)| {
+ if lines.next() != Some(&content) {
reflow_applied = true;
}
// the current indentation, if there are more lines than before, we use the indent from the last one
@@ -124,6 +121,7 @@ fn reflow_inner<'s>(
acc.push_str(pref);
acc.push_str(&content);
acc.push_str("\n");
+ dbg!(&acc);
acc
});
