Age | Commit message (Collapse) | Author |
|
Previously, each time it tried to render a table (to check its width), it both re-queried the filesystem and re-formatted the values into coloured strings.
These values are now calculated only once before the table is drawn, and are used repeatedly throughout.
Although it looks as though there's more `clone()`ing going on than before, it used to be recalculating things and storing them as vectors anyway, so the memory would still be used in any case.
|
|
This commit adds --grid, which, when used with --long, will split the details into multiple columns. Currently this is just 2 columns, but in the future it will be based on the width of the terminal.
In order to do this, I had to do two things:
1. Add a `links` parameter to the filename function, which disables the printing of the arrow and link target in the details view. When this is active, the columns get way too large, and it becomes not worth it.
2. Change the `print_table` function from actually printing the table to stdout to returning a list of `Cells` based on the table. This list then gets its width measured to calculate the width of the resulting table.
|
|
|
|
It's now in the locals of the Table struct, and didn't really belong in the column anyway.
|
|
|
|
Exa now uses the new IO, Path, and Filesystem libraries that have been out for a while now.
Unfortunately, the new libraries don't *entirely* cover the range of the old libraries just yet: in particular, to become more cross-platform, the data in `UnstableFileStat` isn't available in the Unix `MetadataExt` yet. Much of this is contained in rust-lang/rfcs#1044 (which is due to be implemented in rust-lang/rust#14711), but it's not *entirely* there yet.
As such, this commits a serious loss of functionality: no symlink viewing, no hard links or blocks, or users or groups. Also, some of the code could now be optimised. I just wanted to commit this to sort out most of the 'teething problems' of having a different path system in advance.
Here's an example problem that took ages to fix for you, just because you read this far: when I first got exa to compile, it worked mostly fine, except calling `exa` by itself didn't list the current directory. I traced where the command-line options were being generated, to where files and directories were sorted, to where the threads were spawned... and the problem turned out to be that it was using the full path as the file name, rather than just the last component, and these paths happened to begin with `.`, so it thought they were dotfiles.
|
|
Still missing a few Beta features, but it compiles!
- Copy requires Clone
- current_dir returns a Path now
- num_cpus moved to a crate
|
|
|
|
Move most of the heavy lifting into a Table struct, which doesn't govern how the resulting table is *created*, only how it's *displayed*.
|
|
Conflicts:
src/file.rs
|
|
Get rid of explicit `as_slice()` calls
|
|
|
|
|
|
|
|
|
|
|
|
Otherwise, just display the hour and minute.
|
|
Using the datetime crate, add an extra column to the --long view that
prints out the modified, accessed, or created timestamp for each file.
Also, let the user pick which one they want to see based on the --time
command-line option.
|
|
- Turn the views and main program loop into structs, rather than just as one gigantic function
- Separate views into their own files
The addition of the git column and the tree view meant that a lot of functions now just took extra arguments that didn't seem to fit. For example, it didn't really work to have only one 'view' method that printed out everything, as the different view options now all take different parameters.
|
|
FileName was always a special-cased column, as it was assumed to be the last column in the output. Now, it's explicitly marked as such. This allows the hash marks to be placed before the filename, rather than at the start of the line.
|
|
This is something that I've long wanted to add. It uses libgit2 as an optional dependency.
|
|
|
|
|
|
Instead of stripping the ANSI formatting characters from our strings, work out the length without them and use that. This is per-column, but most of them are simple (just the same number of characters in the non-coloured string).
Sometimes, this is really simple: for example, trwxrwxrwx permissions strings are always going to be ten characters long, and the strings that get returned are chock full of ANSI escape codes.
This should have a small benefit on performance.
|
|
|
|
|
|
|
|
- uint -> usize
- getopts Cargo library
- replace feature gates with unstable APIs
|
|
std::str changes, and the way macros are expanded.
|
|
|
|
|
|
|
|
- Prefer iter over into_iter where appropriate
- Cut down on cloning
|
|
|
|
- Remove uses of to_string() on a &str where it wasn't necessary
- Use SendStr to reduce allocations further
|
|
|
|
|
|
|