Просмотр исходного кода

Display icons when file names are too long for grid

Fixes ogham/exa#548
James Tai 6 лет назад
Родитель
Сommit
dd9dffff8c
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      src/output/grid.rs

+ 3 - 0
src/output/grid.rs

@@ -63,6 +63,9 @@ impl<'a> Render<'a> {
             // This isn’t *quite* the same as the lines view, which also
             // This isn’t *quite* the same as the lines view, which also
             // displays full link paths.
             // displays full link paths.
             for file in &self.files {
             for file in &self.files {
+                if self.opts.icons {
+                    write!(w, "{}", painted_icon(&file, &self.style))?;
+                }
                 let name_cell = self.style.for_file(file, self.colours).paint();
                 let name_cell = self.style.for_file(file, self.colours).paint();
                 writeln!(w, "{}", name_cell.strings())?;
                 writeln!(w, "{}", name_cell.strings())?;
             }
             }