From f7af53701896cf672bcec10bfd7aadccceed0fa3 Mon Sep 17 00:00:00 2001 From: sharkdp Date: Tue, 8 May 2018 22:29:50 +0200 Subject: [PATCH] Filter out languages without extensions --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index befdde92..227c75a5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -571,14 +571,14 @@ fn run() -> Result<()> { let longest = languages .iter() - .filter(|s| !s.hidden) + .filter(|s| !s.hidden && s.file_extensions.len() > 0) .map(|s| s.name.len()) .max() .unwrap_or(32); // Fallback width if they have no language definitions. let separator = " "; for lang in languages { - if lang.hidden { + if lang.hidden || lang.file_extensions.len() == 0 { continue; } print!("{:width$}{}", lang.name, separator, width = longest);