Fix formatting: break long lines for rustfmt compliance
Rustfmt requires long chained method calls to be broken across multiple lines when they exceed line length limits. Changes: - Break visual_width() iterator chains in renderer.rs - Break visual_width() iterator chains in terminal.rs - Fix comment alignment in ansi.rs 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -8,7 +8,7 @@ pub fn strip_ansi(text: &str) -> String {
|
||||
// Skip ANSI escape sequence
|
||||
if chars.peek() == Some(&'[') {
|
||||
chars.next(); // consume '['
|
||||
// Skip until we hit a letter (the command character)
|
||||
// Skip until we hit a letter (the command character)
|
||||
while let Some(&c) = chars.peek() {
|
||||
chars.next();
|
||||
if c.is_ascii_alphabetic() {
|
||||
|
||||
@@ -69,7 +69,11 @@ impl TerminalManager {
|
||||
|
||||
pub fn print_centered(&self, text: &str) -> Result<()> {
|
||||
let lines: Vec<&str> = text.lines().collect();
|
||||
let max_width = lines.iter().map(|l| ansi::visual_width(l)).max().unwrap_or(0) as u16;
|
||||
let max_width = lines
|
||||
.iter()
|
||||
.map(|l| ansi::visual_width(l))
|
||||
.max()
|
||||
.unwrap_or(0) as u16;
|
||||
let height = lines.len() as u16;
|
||||
|
||||
let start_x = (self.width.saturating_sub(max_width)) / 2;
|
||||
|
||||
Reference in New Issue
Block a user