on master help sign in
Filter out languages without extensions
commitf7af53701896cf672bcec10bfd7aadccceed0fa3 authorsharkdp <davidpeter@web.de> dateTue 8 May 2018, 22:29 (9 years ago) parentfd68af8
1 file changed+2−2
src/main.rs+2−2
src/main.rs+2−2
@@ -571,14 +571,14 @@ fn run() -> Result<()> {
571571
572572 let longest = languages
573573 .iter()
574− .filter(|s| !s.hidden)
574+ .filter(|s| !s.hidden && s.file_extensions.len() > 0)
575575 .map(|s| s.name.len())
576576 .max()
577577 .unwrap_or(32); // Fallback width if they have no language definitions.
578578
579579 let separator = " ";
580580 for lang in languages {
581− if lang.hidden {
581+ if lang.hidden || lang.file_extensions.len() == 0 {
582582 continue;
583583 }
584584 print!("{:width$}{}", lang.name, separator, width = longest);