Commit Graph

31 Commits

Author SHA1 Message Date
Bond_009
f599c7ce93 Update to Rust 2018 2019-07-19 20:40:21 +02:00
Benjamin Sago
faed8f9b82
Merge pull request #457 from ariasuni/fix-sorting-by-created-time
Fix sorting by created time
2019-07-15 03:30:52 +01:00
Bernardo Meurer
2d0768c8d2
Fix usages of number_prefix 2019-04-16 22:54:06 -07:00
ariasuni
b0da0c9055 Use correct metadata for created time 2019-03-23 17:18:18 +01:00
Benjamin Sago
058b4a57bd Bump users crate version
And remove an unnecessary allocation while we’re at it. Fixes #442
2018-12-07 00:59:05 +00:00
ariasuni
80b0d9dd0d Display if a file is ignored by git 2018-11-20 18:12:38 +01:00
Thibaut Brandscheid
755876e9b6 fix most clippy warnings 2018-06-19 17:17:39 +02:00
Benjamin Sago
d86fc4286b \t and \s+$ 2017-08-26 23:54:12 +01:00
Benjamin Sago
276d18cf7c Give block and character devices different colours
There are now two device colours instead of one. Even though they’re both set to the same style for the default colour set, LS_COLORS allows the two to look different, so exa has to support it too.

It’s probably a good idea to support it anyway.
2017-08-26 14:30:33 +01:00
Benjamin Sago
9b24649d68 Reverse what knows how to render a cell
This commit adds many traits, all named ‘Colours’, to the code. Each one asks for a colour needed to render a cell: the number of links asks for colours for the number and the multi-link-file special case; the file size asks for number, unit, punctuation, and device ID colours, or it can do a scale with its own colours, however it wants.

This is a step towards LS_COLORS compatibility, believe it or not. If a text cell in a column doesn’t depend on Colours to render itself, then the source of the colours is open-ended.

I am glad to have not needed any test changes here.
2017-08-20 20:29:23 +01:00
Benjamin Sago
0b30864f10 \t 2017-08-20 18:14:40 +01:00
Benjamin Sago
aa5b1867dd Make nanoseconds available to times
The information was always in the Metadata struct; exa just never used it.
2017-07-05 23:08:56 +01:00
Benjamin Sago
268b7d52dc Rename Columns to table::Options
The views have been renamed to be the Optionses of their module; now the options for the Table — Columns — has followed suit.

This works out, because the table module depended on everything in the columns module. It opens the door for other only-table-specific things to be included.

The casualty was that by making it non-Clone and non-PartialEq, a bunch of other #[derive]-d types had to have their derivions removed too.
2017-07-05 20:16:04 +01:00
Benjamin Sago
652e27e6dd Extract time formatter
This commit collects all the time-related fields from the Environment and bundles them all together in their own encapsulated struct.
2017-07-03 08:45:14 +01:00
Benjamin Sago
aea0035f94 Move Colour and Classify to the View
All four view types — lines, grid, details, and grid-details — held their own colours and classify flags.

This didn’t make any sense for the grid-details view, which had to pick which one to use: the values were in there twice.

It also gave the Table in the details view access to more information than it really should have had.

Now, those two flags are returned separately from the view “mode”, which is the new term for one of those four things.
2017-06-24 22:39:15 +01:00
Benjamin Sago
a2901c63cf Render higher permission bits
Unlike the others, setuid/setgid/sticky get merged with user/group/other execute in the rendered Permissions cell. So there had to be a bit of code change done to make sure that none of the bits clashed.
2017-05-30 15:31:24 +01:00
Benjamin Sago
f9f7ad2230 Read setuid/setgid/sticky bits
The problem here was that we were using `metadata.permissions().mode()`, which is capped at 0o777, rather than `metadata.mode()`, which exposes every bit. With this change, we can access the higher-order permission bits, and put them in the Permissions struct.
2017-05-30 15:29:29 +01:00
Benjamin Sago
b5d5509657 Timestamps will need more work 2017-05-22 08:52:45 +01:00
Benjamin Sago
4a5cb5361d Inode is probably the easiest one 2017-05-22 08:51:34 +01:00
Benjamin Sago
094e660003 Monday morning Blocks extraction 2017-05-22 08:48:32 +01:00
Benjamin Sago
eec81c4f48 Monday morning Links extraction 2017-05-22 08:43:09 +01:00
Benjamin Sago
f0cf5b4538 A Git status character should render itself, too 2017-05-21 17:01:22 +01:00
Benjamin Sago
5f497da85d This actually makes the Git part big enough
…for its own module.
2017-05-21 16:59:02 +01:00
Benjamin Sago
9642f69ce7 Tests for Git rendering 2017-05-21 16:54:40 +01:00
Benjamin Sago
eb0bede837 Move the rest of the rendering into the render mod
On the plus side, this removes some imports from details, and makes the file shorter. On the minus side, the ‘render timestamp’ function has a hell of a signature.
2017-05-21 15:30:08 +01:00
Benjamin Sago
e83b019854 Inline field 2017-05-21 11:12:33 +01:00
Benjamin Sago
957c1925b1 PermissionsPlus holds the leftmost column values
The three pieces of information for the leftmost details view column (file type, permissions, and whether xattrs are present) used to be gathered from separate sources and passed around separately before being displayed at the end. Now, file type and permissions are put into a struct, along with the xattrs boolean that’s still getting passed around all over the place but not quite as much.

This was all done because I wanted to be able to test permissions rendering, without having file type and xattrs dragged into the same function.
2017-05-21 10:48:27 +01:00
Benjamin Sago
a2eb724483 Add unit tests for size rendering 2017-05-21 09:49:17 +01:00
Benjamin Sago
ddd34f3b1f Make DeviceIDs its own type
This is so we can define a render method on it.
2017-05-20 21:55:18 +01:00
Benjamin Sago
24a5d71f4b Extract file type render function 2017-05-20 21:49:00 +01:00
Benjamin Sago
fdd053d735 Put all the rendering functions into their own module 2017-05-20 21:45:08 +01:00