fixed alignment bug, removed test print
This commit is contained in:
parent
1b05a7c4bf
commit
159924dffc
|
@ -44,13 +44,25 @@ fn bubble_from_lines(lines: Vec<String>, min_length: usize) -> String {
|
|||
)
|
||||
}
|
||||
n => {
|
||||
bubble_body.push_str(&format!("/ {:<line_length$} \\\n", lines[0]));
|
||||
bubble_body.push_str(&manipulate::pad_left(
|
||||
&format!("/ {} \\\n", lines[0]),
|
||||
pad_length,
|
||||
" ",
|
||||
));
|
||||
if n > 2 {
|
||||
for i in 1..n - 1 {
|
||||
bubble_body.push_str(&format!("| {:<line_length$} |\n", lines[i]));
|
||||
bubble_body.push_str(&manipulate::pad_left(
|
||||
&format!("| {} |\n", lines[i]),
|
||||
pad_length,
|
||||
" ",
|
||||
));
|
||||
}
|
||||
}
|
||||
bubble_body.push_str(&format!("\\ {:<line_length$} /\n", lines[n - 1]));
|
||||
bubble_body.push_str(&manipulate::pad_left(
|
||||
&format!("\\ {} /\n", lines[n - 1]),
|
||||
pad_length,
|
||||
" ",
|
||||
));
|
||||
return format!("{}{}{}", bubble_top, bubble_body, bubble_bottom);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ TO DO
|
|||
- kijefiles
|
||||
- other aminals
|
||||
- pakala
|
||||
- pilin
|
||||
*/
|
||||
|
||||
mod bubbles;
|
||||
|
@ -28,7 +29,6 @@ fn main() {
|
|||
.expect("failed to read input");
|
||||
}
|
||||
output(&text, config);
|
||||
println!("{}test{}", FourBit::BrightCyan.escape(false), kule::reset());
|
||||
}
|
||||
|
||||
#[derive(Parser, Debug)]
|
||||
|
|
Loading…
Reference in a new issue