Commit Graph

67 Commits

Author SHA1 Message Date
cab-1729 45b6413fd0
Added icon for img files 2022-07-17 16:22:20 +05:30
cab-1729 a65c52d821
Add files via upload 2022-06-26 21:40:00 +05:30
cab-1729 954462634a
Added icons for .pm similar to .pl 2022-06-17 16:44:39 +05:30
Ryooooooga 6197006d5f
add Go module icons 2022-04-23 10:18:42 +09:00
Mélanie Chauvel fc6a6d0b38
Merge pull request #1045 from sorairolake/format/cpio
Add cpio filetype
2022-03-22 15:17:15 +01:00
Shun Sakai bced9841f4 Add JPEG 2000 filetype 2022-03-20 12:36:54 +09:00
Shun Sakai f5bbfa7871 Add cpio filetype 2022-03-18 16:51:06 +09:00
Mélanie Chauvel 0659c36897
Merge pull request #1008 from jvaverka/patch-1
Update icons.rs
2022-03-17 19:36:25 +01:00
Mélanie Chauvel a58a3313ea
Merge pull request #1013 from ricpelo/fix-icons
Uses same icon for lib, xml & xul files (fix #891)
2022-03-17 19:29:14 +01:00
Philippe Eberli fe64690063
Change icon for gradle files to Java (#1017)
* Change icon for gradle files to Java

Gradle files are for the whole Java ecosystem. Not just Android.

* Change the icon for jar & java to 

Other java related files (class, jad, war) already use this.
2022-03-17 18:05:37 +01:00
Ricardo Pérez 400bb0a140 Use same icon for lib, xml & xul files (fix #891) 2022-01-23 19:52:06 +01:00
Jacob Vaverka e433b3fed0
Update icons.rs
Add Markdown icon for Julia Markdown documents (same convention as for `*.Rmd`)
2022-01-10 11:46:23 -05:00
Christian Höltje 42659f9345
add icon for .bats files (#968)
* add icon for .bats files

This adds the same icon as BASH for `.bats` files.

Co-authored-by: Mélanie Chauvel <perso@hack-libre.org>
2022-01-05 00:10:24 +01:00
Mélanie Chauvel a2f3ff98c2
Merge pull request #993 from cab-1729/master
Adding icons for .part and .torrent files
2022-01-05 00:09:31 +01:00
Mélanie Chauvel 4f919a6bc5
Merge pull request #989 from foundObjects/add-filetypes
Add file icons for zst and Arch Linux PKGBUILD
2022-01-05 00:03:58 +01:00
Sam James 89d537adb4 icons: add Gentoo for .ebuild
Signed-off-by: Sam James <sam@gentoo.org>
2022-01-03 04:43:29 +00:00
cab-1729 091ab51b98
Add files via upload 2021-12-15 21:08:30 +05:30
Ashin Antony 859666d287
feat: Add julia file extension icon
Icon for julia file extension '.jl' is added to the icons list.
2021-12-14 17:46:30 +05:30
Scott B c4b8e7af1a add PKGBUILD file icon 2021-12-10 18:21:03 -08:00
Scott B 69ae5db3b6 add zst file icon 2021-12-10 18:04:57 -08:00
jim4067 4220b6f41e add lz4 file type and icon 2021-10-03 13:16:47 +03:00
Mélanie Chauvel a7aca35d97
Merge pull request #957 from hellosway/patch-1
Recognize .jxl and .avif as image files
2021-10-03 01:11:01 +02:00
jim4067 247d1345e7 fix: add compression icon to .tXX files #930 2021-10-02 20:05:32 +03:00
hellosway 1c36b71779
Add avif and jxl icons 2021-09-27 16:36:17 -07:00
Joshua Gawley 11793973fe
Add Makefile icon (#945)
* Add icon for .mk files
* Updated icon for Makefile
2021-09-03 18:10:15 +02:00
xxkfqz 8de5b97804 fix: more JPG extensions 2021-07-02 15:02:06 +05:00
Matthew Gleich 56c78400b8
feat: add sty file
Signed-off-by: Matthew Gleich <git@mattglei.ch>
2021-05-18 00:12:17 -04:00
Christian Göttsche 61ec153bcd Cleanup clippy warnings
warning: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)
 --> src/output/escape.rs:4:1
  |
4 | pub fn escape<'a>(string: String, bits: &mut Vec<ANSIString<'a>>, good: Style, bad: Style) {
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |

warning: this lifetime isn't used in the function definition
 --> src/output/escape.rs:4:15
  |
4 | pub fn escape<'a>(string: String, bits: &mut Vec<ANSIString<'_>>, good: Style, bad: Style) {
  |               ^^
  |

warning: single-character string constant used as pattern
   --> src/output/table.rs:310:41
    |
310 |                     if file.starts_with(":") {
    |                                         ^^^ help: try using a `char` instead: `':'`
    |

warning: single-character string constant used as pattern
   --> src/output/table.rs:310:41
    |
310 |                     if file.starts_with(":") {
    |                                         ^^^ help: try using a `char` instead: `':'`
    |

warning: methods called `new` usually return `Self`
  --> src/output/render/git.rs:38:5
   |
38 |     fn new(&self) -> Style;
   |     ^^^^^^^^^^^^^^^^^^^^^^^
   |

warning: this lifetime isn't used in the function definition
  --> src/output/icons.rs:40:22
   |
40 | pub fn iconify_style<'a>(style: Style) -> Style {
   |                      ^^
   |

warning: lint `clippy::find_map` has been removed: this lint has been replaced by `manual_find_map`, a more specific lint
  --> src/main.rs:11:10
   |
11 | #![allow(clippy::find_map)]
   |          ^^^^^^^^^^^^^^^^
   |

warning: redundant else block
   --> src/fs/dir.rs:124:18
    |
124 |               else {
    |  __________________^
125 | |                 return None
126 | |             }
    | |_____________^
    |

warning: redundant else block
  --> src/options/view.rs:60:18
   |
60 |               else {
   |  __________________^
61 | |                 // the --tree case is handled by the DirAction parser later
62 | |                 return Ok(Self::Details(details));
63 | |             }
   | |_____________^
   |

warning: all variants have the same postfix: `Bytes`
   --> src/output/table.rs:170:1
    |
170 | / pub enum SizeFormat {
171 | |
172 | |     /// Format the file size using **decimal** prefixes, such as “kilo”,
173 | |     /// “mega”, or “giga”.
...   |
181 | |     JustBytes,
182 | | }
    | |_^
    |

warning: all variants have the same postfix: `Bytes`
   --> src/output/table.rs:171:1
    |
171 | / pub enum SizeFormat {
172 | |
173 | |     /// Format the file size using **decimal** prefixes, such as “kilo”,
174 | |     /// “mega”, or “giga”.
...   |
182 | |     JustBytes,
183 | | }
    | |_^
    |

warning: useless use of `format!`
   --> src/options/mod.rs:181:50
    |
181 |               return Err(OptionsError::Unsupported(format!(
    |  __________________________________________________^
182 | |                 "Options --git and --git-ignore can't be used because `git` feature was disabled in this build of exa"
183 | |             )));
    | |_____________^ help: consider using `.to_string()`: `"Options --git and --git-ignore can't be used because `git` feature was disabled in this build of exa".to_string()`
    |

warning: stripping a prefix manually
   --> src/fs/filter.rs:287:33
    |
287 |         if n.starts_with('.') { &n[1..] }
    |                                 ^^^^^^^
    |

warning: case-sensitive file extension comparison
  --> src/info/filetype.rs:24:19
   |
24 |         file.name.ends_with(".ninja") ||
   |                   ^^^^^^^^^^^^^^^^^^^
   |
2021-04-30 15:37:31 +02:00
Prunkles 7a26b4e0f7 Add F# icons 2021-04-26 08:05:05 +03:00
Benjamin Sago e3e776a1fa Use better icon for TeX files
Fixes GH-777.
2021-04-12 22:23:51 +01:00
Stuart Carnie c946bab08e
chore: PR feedback 2021-02-28 07:48:00 +11:00
Stuart Carnie 765fcf64c9
Update src/output/icons.rs
Co-authored-by: Mélanie Chauvel <perso@hack-libre.org>
2021-02-28 07:43:42 +11:00
Stuart Carnie c42e0b3945
feat: New Icons and CLI argument to suppress icons 2021-02-28 07:18:17 +11:00
Benjamin Sago 976db01b3e Prefer background colour when painting icons
The rationale here is that there's more of a background colour than the foreground colour when painting text, and having a gap of no background colour in between the icon and the file name looks weird.

Fixes GH-561.
2020-10-24 18:29:28 +01:00
Benjamin Sago 67a6cdd46a Make icon styles appropriate for all file types
exa now bases the icon style for a file on its file name and kind in all cases, rather than just on its file name. This means that directories and symlinks have the correctly-coloured icon.

It also only takes the foreground colour into account while styling the icon, to make sure they're not bold or underlined.

Fixes GH-528.
2020-10-24 18:16:38 +01:00
Benjamin Sago f1e3e7c7ff Move icon generation into file name module
This commit makes adding icons to file names something that the file name renderer does, rather than something that each individual view does. This is now possible thanks to the previous commit a1869f2, which moved the option to do this into the same module. The repeated code has been removed.

It happens to fix a bug where the width of each column was being incorrectly calculated for the grid-details view, making lines slightly too long for the terminal because the icon wasn't being taken into account.
2020-10-24 18:03:36 +01:00
Benjamin Sago 3419afa7cf Massive theming and view options refactor
This commit significantly refactors the way that options are parsed. It introduces the Theme type which contains both styling and extension configuration, converts the option-parsing process into a being a pure function, and removes some rather gnarly old code.

The main purpose of the refactoring is to fix GH-318, "Tests fail when not connected to a terminal". Even though exa was compiling fine on my machine and on Travis, it was failing for automated build scripts. This was because of what the option-parsing code was trying to accomplish: it wasn't just providing a struct of the user's settings, it was also checking the terminal, providing a View directly.

This has been changed so that the options module now _only_ looks at the command-line arguments and environment variables. Instead of returning a View, it returns the user's _preference_, and it's then up to the 'main' module to examine the terminal width and figure out if the view is doable, downgrading it if necessary.

The code that used to determine the view was horrible and I'm pleased it can be cut out. Also, the terminal width used to be in a lazy_static because it was queried multiple times, and now it's not in one because it's only queried once, which is a good sign for things going in the right direction.

There are also some naming and organisational changes around themes. The blanket terms "Colours" and "Styles" have been yeeted in favour of "Theme", which handles both extensions and UI colours. The FileStyle struct has been replaced with file_name::Options, making it similar to the views in how it has an Options struct and a Render struct.

Finally, eight unit tests have been removed because they turned out to be redundant (testing --colour and --color) after examining the tangled code, and the default theme has been put in its own file in preparation for more themes.
2020-10-22 22:34:00 +01:00
Benjamin Sago 3dc86c99ad New set of lints, and Rust 2018 idioms 2020-10-13 01:36:41 +01:00
Benjamin Sago f8df02dae7 Batch source formatting
I read through every file and applied a couple of rustfmt suggestions. The brace placement and alignment of items on similar lines has been made consistent, even if neither are rustfmt's default style (a file has been put in place to enforce this). Other changes are:

• Alphabetical imports and modules
• Comma placement at the end of match blocks
• Use newlines and indentation judiciously
• Spaces around associated types
• Spaces after negations (it makes it more clear imho)
• Comment formatting
• Use early-returns and Optional `?` where appropriate
2020-10-10 20:02:55 +01:00
Benjamin Sago f0c139ca68 Better referencing
This commit makes changes to the way variables are referenced:

• Make types Copy when possible
• Make methods take `self` instead of `&self` where possible (trivially_copy_pass_by_ref)
• Remove unnecessary borrowing (needless_ref)
• Remove unnecessary cloning (clone_on_copy)
• Remove `ref` from match arms where possible (new Rust match ergonomics)
2020-10-10 15:30:19 +01:00
Benjamin Sago 70a30ed683 The Selfening
This commit uses Clippy to fix all the 'use_self' warnings. Using Self instead of the type name has been good Rust style for a while now, and it's become the style I'm used to seeing.
2020-10-10 13:55:26 +01:00
Benjamin Sago 7f9773b68e Merge branch 'zachcoyle-add-nix-icon' 2020-10-08 22:56:24 +01:00
Benjamin Sago fd3a3d13b7 Merge branch 'add-nix-icon' of https://github.com/zachcoyle/exa into zachcoyle-add-nix-icon
# Conflicts:
#	src/output/icons.rs
2020-10-08 22:56:16 +01:00
Benjamin Sago 9240dbdef3
Merge pull request #734 from imsofi/master
Fix icons for symlinked directories
2020-10-08 22:41:59 +01:00
Benjamin Sago d03e39c367 Merge branch 'master' of https://github.com/JavaCafe01/exa into JavaCafe01-master
Change a bunch of the existing shell-related icons to the new Unicode escape.
# Conflicts:
#	src/output/icons.rs
2020-10-08 22:30:20 +01:00
Benjamin Sago 1ee8fab7de Merge branch 'master' of https://github.com/DiegoMagdaleno/exa into DiegoMagdaleno-master
# Conflicts:
#	src/output/icons.rs
2020-10-08 22:23:18 +01:00
Benjamin Sago 12e45ac41c Merge branch 'master' of https://github.com/danielbayley/exa into danielbayley-master
# Conflicts:
#	src/output/icons.rs
2020-10-08 22:00:36 +01:00
Zach Coyle 3b1d770f8a
Add Nix Icon 2020-09-26 23:36:24 -04:00
imsofi 0a7ffcd042
Fix icons for symlinked directories 2020-09-08 22:27:39 +02:00
Gokul Swaminathan 43a4fcb27a Updated filetype icons
Added icon for filetype `.sh`
2020-08-14 01:11:44 -07:00