Commit Graph

686 Commits

Author SHA1 Message Date
Lukas Rysavy
2fc56d45ca fixed git status not working in directories containing '../' 2018-04-13 22:23:46 +02:00
Benjamin Sago
63a1035158
Merge pull request #355 from alexmaco/performance_tweaks
Create worker threads only once (for performance)
2018-03-16 17:23:58 +00:00
Benjamin Sago
9896f9ed78
Merge pull request #343 from BenWhitehead/mix-hidden-sorting
Add new sort option `.name` and `.Name`
2018-03-16 16:46:55 +00:00
Benjamin Sago
b16a78942c
Merge pull request #366 from dguo/ts-extension
Don't treat .ts as a video file extension
2018-03-15 20:42:26 +00:00
Benjamin Sago
3614f5513d
Merge pull request #356 from joshleeb/highlight-lowercase-readme
Case Insensitive README.* Files As immediate
2018-03-15 20:41:44 +00:00
Danny Guo
e711dbc0b6
Don't treat .ts as a video file extension
It's arguably more frequently used for TypeScript files.
2018-03-14 20:34:46 -04:00
Benjamin Sago
f757300718 Upgrade libgit2
The ogham/git2-rs repository that exa uses in the Vagrant VM has also been updated. The only casualty was that some constants got namespaced.
2018-03-11 11:25:06 +00:00
Benjamin Sago
48cdf22f46
Merge pull request #345 from ogham/exa/remove-unused-import
remove unused import
2018-03-11 09:43:33 +00:00
Benjamin Sago
9bd0334d1a
Merge pull request #342 from ogham/exa/patch-1
Add Bazel and ANT files to immediate files types
2018-03-11 09:41:09 +00:00
Josh Leeb-du Toit
d9c9dbe89e Case insensitive README.* files are immediate
Files with the prefix `README` are now classified as immediate, meaning
they will be highlighted amongst other things, in a case insensitive
way.
2018-02-15 21:55:52 +11:00
Alexandru Macovei
8cbde76b4c Create worker threads only once (for performance)
This improves performance by a factor of at least 2 in large --tree workloads by avoiding the repeated creation/destruction of the pool and containing threads.
Cycling pools also encountered lots lock contention, which accounted for most of the time saved by reusing a single pool.
2018-02-14 03:59:46 +02:00
Ryan Leung
e1a4ed87f2 add #[allow(unused)] for compatibility 2018-02-01 14:52:01 +08:00
Ryan Leung
7fb0347e93 remove unused import 2018-01-31 15:05:20 +08:00
BenWhitehead
a156d96768 Add new sort option .name and .Name
Add two new sort options `.name` and `.Name` which with ignore a leading
`.` if present on the file name before sorting according to `name` and
`Name`.

This new sort is convenient if you want to list hidden and unhidden
files sorted together.
2018-01-30 15:01:56 -08:00
Marco Farrugia
c635031661
Add Bazel and ANT files to immediate files types 2018-01-28 19:26:37 -05:00
ne-sted
5fae489717 Update filetype.rs
add `zst` extension
2017-11-20 13:50:08 +02:00
Benjamin Sago
c7497f3778 Display more information for non-release releases 2017-10-08 20:09:46 +01:00
Benjamin Sago
e154b58268 Move EXA_DEBUG variable to vars file 2017-10-08 17:24:50 +01:00
Benjamin Sago
a45bcfe058 Rename broken_arrow to broken_symlink 2017-10-08 17:08:07 +01:00
Benjamin Sago
91334d601c Use colour traits when possible 2017-10-08 17:08:07 +01:00
Benjamin Sago
59d9e90f20 Replace “mi” colour with “bO” overlay
Fixes #288, but more-or-less as a side-effect.

The “mi” key in LS_COLORS was meant to be used for a missing link path, but it wasn’t really used like that. There was also a bug where control characters in a broken symlink’s path were assumed to be underlined, because that’s what happened in the default colour scheme, but this assumption doesn’t hold when colours were disabled.

The solution to these was not to introduce another configurable colour code, but to start using _overlays_ to alter a bunch of colours at once. The “mi” code will have to be added back later.
2017-10-08 17:08:07 +01:00
Chet Gurevitch
afc9657434 Fix LS_COLORS 01 and 04 detection 2017-10-05 20:55:43 -07:00
Benjamin Sago
9cfc70f4c0 Further shortening 2017-10-02 09:45:55 +02:00
Benjamin Sago
c7748fb1f0 Make these lines less long 2017-10-02 09:43:49 +02:00
Benjamin Sago
937b325e3a Add some ignored tests for sub-globbing 2017-09-30 09:17:29 +02:00
Benjamin Sago
166d1f5e5a Glob pattern ignore tests 2017-09-30 09:17:29 +02:00
Benjamin Sago
541e6855f2 Test some actual ignore caches 2017-09-30 09:17:29 +02:00
Benjamin Sago
476299e21f A note to my future self
It’s important to capture the current behaviour, even if it ends up being totally wrong.
2017-09-30 09:17:29 +02:00
Benjamin Sago
108dc80944 Ignore comments and blank lines when ignoring 2017-09-30 09:17:29 +02:00
Benjamin Sago
7b5b02d9f1 Extract function for parsing an ignore file 2017-09-30 09:17:29 +02:00
Benjamin Sago
1f23f3f0cc Don’t ignore .gitignore errors 2017-09-30 09:17:29 +02:00
Benjamin Sago
3d3ee8fd66 Typo fix 2017-09-30 09:17:29 +02:00
Benjamin Sago
827aa8bfc3 Ignore files matched in .gitignore
This doesn’t *completely* work: it seems to have trouble with ignored paths beginning with slashes, possibly amongst others. Also, .gitignore scanning could be made more efficient.
2017-09-30 09:17:29 +02:00
Benjamin Sago
b95446d834 Thread an ignore cache through the program
!
2017-09-30 09:17:29 +02:00
Benjamin Sago
07443e87ba Add a --git-ignore option that doesn’t do anything
!!
2017-09-30 09:17:28 +02:00
Clar Charr
eda3e56e4c Add .bk extension to is_temp. 2017-09-17 23:08:25 -04:00
Benjamin Sago
4819c4721b Fix compile error with --no-default-features
Fixes #283. Also, have Travis compile without default features either, so I get warned the next time I break it.
2017-09-14 11:33:24 +01:00
Benjamin Sago
c475cccce4 Flip the new/old order, and add suggestion for -lt
I changed my mind about which way round sorting by “newest” or by “oldest” should actually go. If you’re listing a large directory, you see the last lines of the output first, so these files should be the ones with the largest whatever the sort field is. It’s about sorting *last*, not sorting *first*. Sorting by size wouldn’t say “sorts smallest files first”, it would say “sorts largest files last”. Right?

Also, add a new suggestion that warns against “ls -lt”.
2017-09-14 09:18:17 +01:00
Benjamin Sago
a8bf990674 Tie value suggestions to their arguments
This commit changes the definition of Arg so that it knows about which values it can accept, and can display them in the help text. They were already being shown in the help text, but they were passed in separately, so one argument could show two different sets of options if it wanted. Now, the argument itself knows whether there are suggestions, so it doesn’t have to be passed in separately.

This means we can use it for other things, including listing choices when an option is missed out, without having to repeat the list.

With Misfire::BadArgument now only having two fields, it’s not worth using a constructor function anymore.
2017-09-14 01:22:37 +01:00
Benjamin Sago
1824313cda Put misfire.rs in a nicer order
The main type is now at the top.
2017-09-13 23:49:30 +01:00
Benjamin Sago
43bbf00478 Show a warning when running ‘exa -ltr’
Raised in #243 and #284. exa isn’t able to override the -t option like this, so the least it can do is detect that case (which is going to be an error case anyway) and show a suggestion.
2017-09-13 23:47:19 +01:00
Benjamin Sago
0fefc78cbb Add more modified date aliases
I don’t really see the modified date as the *modified* date, rather just the *date* field, because it’s the date field I refer to like 99.9% of the time. So now it has aliases to match.

Also are included are aliases for the reverse order, because I’d rather write “new” than “the reverse of old”.
2017-09-13 23:26:06 +01:00
Benjamin Sago
19b7780755 Fix typo in error message
It said “(Choices: (choices: this, that, other))” instead of “(choices: this, that, other)”. Also improve the same error elsewhere: options more have ‘settings’ than ‘values’.
2017-09-13 22:37:51 +01:00
Benjamin Sago
68e70bf036 Reword this comment 2017-09-13 22:12:11 +01:00
Benjamin Sago
dc45332d7b Implement file name colouring in {exa,ls}_colors
This commit adds to the parsing of the LS_COLORS and EXA_COLORS variables so that non-two-letter codes (keys other than things like ‘di’ or ‘ln’ or ‘ex’) will be treated as file name globs, and get used to colour files accordingly.

Fixes #116 for good.
2017-09-13 08:51:57 +01:00
Benjamin Sago
b86074d63b Rename Style to Styles to avoid a name clash 2017-09-13 08:44:59 +01:00
Benjamin Sago
28b4b672d4 Move FileStyle to the same options file as Colours
They are going to be deduced together (from the same environment variable) so it makes sense to put them in the same file first.
2017-09-03 19:50:40 +01:00
Benjamin Sago
4507edd734 256 colour support in ls_colors
This is more annoying than it should be because it has to work with Styles rather than with strings, which means parsing them, and parsing is always tricky business.
2017-09-03 17:05:38 +01:00
Benjamin Sago
c60ea36a31 Allow --git --tree, too
This works by checking if any of the (immediate) files being listed are under Git, and hiding the column if all aren’t.
2017-09-02 12:53:08 +01:00
Benjamin Sago
9cda05df20 Only display Git column for directories with repos
This fixes the previous commit.
2017-09-02 00:04:22 +01:00