Commit Graph

955 Commits

Author SHA1 Message Date
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
Benjamin Sago
fda88bedc2 Now move file size 2017-05-20 21:43:04 +01:00
Benjamin Sago
3f8b547f2d Now move permissions 2017-05-20 21:21:17 +01:00
Benjamin Sago
753fbc294a Flip the rendering functions around
A field can now render itself using colours and a users reference, rather than a Table doing the rendering. This way, only the relevant fields in the Environment can be made available to the render function, and the test code loses some lines.
2017-05-20 20:29:22 +01:00
Benjamin Sago
f2169faf94 Separate users into users and groups modules 2017-05-20 18:39:37 +01:00
Benjamin Sago
070fc76a8d Split user cell displaying into its own file
The details file was getting quite long, so it’s probably time to split it up
2017-05-20 18:14:04 +01:00
Benjamin Sago
d82e7b8e5c Some explanatory comments 2017-05-19 09:27:38 +01:00
Benjamin Sago
5537dd9b99 Static lifetime elision constants 2017-05-19 09:23:27 +01:00
Benjamin Sago
ef5fa90660 Display device IDs when listing devices
Override the size column for block and charater devices, so it shows the major and minor device IDs instead (which are in the Metadata struct somewhere).

This is what ls does when faced with a device.
2017-05-19 09:20:47 +01:00
Benjamin Sago
de60b95850 Don’t core dump when given invalid UTF-8 arguments
By parsing OsStrings rather than Strings, it’s the getopts crate that’s doing the UTF-8 checking rather than us, so if one of them isn’t valid, it’ll just fail to parse rather than crash exa.

Also, save a few allocations here and there.
2017-05-19 00:08:13 +01:00
Benjamin Sago
2f79b4db03 Start using new shorthand object field syntax 2017-05-18 22:43:32 +01:00
Benjamin Sago
881438881f Merge pull request #184 from kballard/lazy_static
Remove lazy_static crate
2017-05-18 09:04:12 +01:00
Kevin Ballard
15e08338d8 Remove lazy_static crate
It's not being used anymore.
2017-05-17 22:48:11 -07:00
Benjamin Sago
dec445af8f Version bump to 0.6.0 2017-05-18 00:07:22 +01:00
Benjamin Sago
04d33ac1cd Merge pull request #181 from kballard/makefile
More Makefile tweaks
2017-05-17 23:48:26 +01:00
Benjamin Sago
43bc16dba2 Test change emoji width
The change in 0828133300 means that the width of emoji are used. I think the issue https://github.com/unicode-rs/unicode-width/issues/4 means that the wrong width is being calculated for emoji, and there happens to be one in the example.
2017-05-17 23:12:27 +01:00
Benjamin Sago
c57f480478 One last versions bump 2017-05-17 22:37:20 +01:00
Benjamin Sago
ce8a2e7ce9 Handle locales with 4-character-width months 2017-05-17 22:15:53 +01:00
Benjamin Sago
5bec218878 Merge pull request #177 from quininer/cjk
Fix TextCellContents cjk width
2017-05-17 21:18:17 +01:00
Benjamin Sago
510d2f7a76 --help and --version should have exit code 0
This makes it possible to use them in scripts. Also, I couldn’t find any other program returned a different error code! So it’s being changed to 0.

Fixed #180.
2017-05-17 21:01:12 +01:00
Benjamin Sago
e10c4b3eb9 Add xtests for existing Git implementation 2017-05-17 20:35:05 +01:00
Kevin Ballard
625ce231e7 Use pkg-config for FISHDIR/BASHDIR
It looks like zsh doesn't have a pkg-config file so we can't use it for
ZSHDIR.

Fixes #179.
2017-05-16 15:20:31 -07:00
Kevin Ballard
1537759c75 Use DESTDIR when installing/uninstalling completions 2017-05-16 14:48:26 -07:00
Benjamin Sago
ff5896aad2 Merge pull request #176 from kballard/makefile
Fix a bunch of issues with the Makefile
2017-05-16 21:34:26 +01:00
Benjamin Sago
b1be274276 Move scale colours to the Colours struct
Now everything’s customisable (in the future!) in its own place. This was the last thing to do for #65.
2017-05-16 20:54:39 +01:00
Benjamin Sago
10b86aa415 Add xtest for colour scale 2017-05-16 20:53:28 +01:00
Benjamin Sago
108a402dbd Re-prefix the paths found by following symlinks
Fixes #134, a bug that showed symlinks incorrectly as broken, but only when the file was listed directly on the command-line *and* the file was in a different directory to the one exa was being run in.

I’m not sure why the old code used `String::new()`, but it doesn’t seem to affect anything.
2017-05-15 22:38:23 +01:00
quininer kel
0828133300 Fix TextCellContents cjk width 2017-05-10 16:26:50 +08:00
Kevin Ballard
e5764ff703 Fix a bunch of issues with the Makefile
* `$BASHDIR` and `$FISHDIR` had incorrect paths
* Fix `$FEATURES` to actually work
* Add `-f` to `rm` invocations to quiet missing file errors
* Just use `man` to preview the manpage
* Fix (again) `make` not rebuilding
* Add `make help` to view all of the commands and variables
2017-05-08 20:52:23 -07:00
Benjamin Sago
d2b1499fb1 Add thing for installing cargo-kcov 2017-05-07 20:25:53 +01:00
Benjamin Sago
205f18e848 It looks like you’re writing a letter 2017-05-07 17:39:01 +01:00
Benjamin Sago
4335f1978c Low-hanging clippy fruit 2017-05-07 17:15:22 +01:00
Benjamin Sago
86c19a165c Specify panic="abort"
exa doesn’t capture any failures — it’s not really worth it for such a short-lived task, and doing this results in a smaller binary.

Fixes #128.
2017-05-07 16:47:19 +01:00
Benjamin Sago
8f35da6bc8 Add shell completions and man preview to Makefile 2017-05-07 16:28:36 +01:00
Benjamin Sago
06258cb711 Merge pull request #173 from kballard/makefile
Always rebuild with `make`
2017-05-07 15:59:41 +01:00
Benjamin Sago
20b6588552 Merge branch 'master' into makefile 2017-05-07 15:59:24 +01:00
Benjamin Sago
75fff591e8 Merge pull request #115 from maandree/master
Improvements to the makefile
2017-05-07 15:57:14 +01:00
Benjamin Sago
e819dd95e9 Merge branch 'more-file-name-fields' 2017-05-07 15:31:55 +01:00
Benjamin Sago
e916097e0e Similarly, turn Classify into an enum 2017-05-07 15:31:00 +01:00
Benjamin Sago
39381bfb49 Document the recent changes 2017-05-07 15:14:06 +01:00
Benjamin Sago
9f6376a560 Give broken links a different style in grid view
Because the link style and status are now both available to the function that picks the colour style, we can have it highlight broken links differently.

Fixes #131.
2017-05-07 14:45:04 +01:00
Benjamin Sago
ccf8d44058 Replace the links boolean with an enum field 2017-05-07 14:08:36 +01:00
Benjamin Sago
88fecb7b26 Make the link target a field 2017-05-07 10:44:09 +01:00
Benjamin Sago
897d6ffa56 Merge branch 'command-line'
Provides shell completion and makes all the command-line options consistent and complete.

Fixes #150, which tracked shell completion.
2017-05-06 23:01:54 +01:00