@@ -582,14 +582,15 @@ fn run() -> Result<()> {
582582 print!("{:width$}{}", lang.name, separator, width = longest);
583583
584584 // Line-wrapping for the possible file extension overflow.
585− let desired_width = options.term_width - longest;
585+ let desired_width = options.term_width - longest - separator.len();
586586 // Number of characters on this line so far, wrap before `desired_width`
587587 let mut num_chars = 0;
588588
589+ let comma_separator = ", ";
589590 let mut extension = lang.file_extensions.iter().peekable();
590591 while let Some(word) = extension.next() {
591592 // If we can't fit this word in, then create a line break and align it in.
592− if word.len() + num_chars >= desired_width {
593+ if word.len() + num_chars + comma_separator.len() >= desired_width {
593594 num_chars = 0;
594595 print!("\n{:width$}{}", "", separator, width = longest);
595596 }
@@ -597,7 +598,7 @@ fn run() -> Result<()> {
597598 num_chars += word.len();
598599 print!("{}", word);
599600 if extension.peek().is_some() {
600− print!(", ");
601+ print!("{}", comma_separator);
601602 }
602603 }
603604 println!();