1. 10 5月, 2017 1 次提交
  2. 07 5月, 2017 1 次提交
  3. 03 5月, 2017 1 次提交
  4. 01 4月, 2017 1 次提交
  5. 30 10月, 2016 1 次提交
    • B
      Make the views non-Copy · a6712994
      Ben S 提交于
      This has to be done for when ignore patterns get introduced and have to be stored in a Vec.
      a6712994
  6. 19 4月, 2016 1 次提交
  7. 17 4月, 2016 1 次提交
    • B
      Source file rearrangements · efa372cb
      Benjamin Sago 提交于
      This commit moves file, dir, and the feature modules into one parent 'fs' module. Now there are three main 'areas' of the code: main and options, the filesystem-touching code, and the output-displaying code.
      
      It should be the case that nothing in 'output' touches 'std::fs'.
      efa372cb
  8. 10 2月, 2016 1 次提交
    • B
      Update packages to latest versions · 75b2748a
      Ben S 提交于
      - Users v0.5.1, which renames OSUsers to UsersCache
      - Locale v0.2, which returns to libc v0.1
      - Datetime v0.4.2, which mimics the locale update, and puts timezone definitions in:
      - Zoneinfo-data, which is needed to obtain the current timezone
      75b2748a
  9. 17 1月, 2016 1 次提交
    • B
      Use Mutex lock on only the users columns · 7f980935
      Benjamin Sago 提交于
      This makes use of a change in the `users` crate to change which parts of exa's code are accessed under a `Mutex`. The change is that the methods on `Users` can now take just `&self`, instead of `&mut self`. This has a knock-on effect in exa, as many methods now don't need to take a mutable `&self`, meaning that the Mutex can be moved to only containing the users information instead of having to be queried for *every column*. This means that threading should now be a lot faster, as fewer parts have to be executed on a single thread.
      
      The main change to facilitate this is that `Table`'s structure has changed: everything environmental that gets loaded at the beginning is now in an `Environment` struct, which can be mocked out if necessary, as one of `Table`'s fields. (They were kind of in a variety of places before.)
      
      Casualties include having to make some of the test code more verbose, as it explicitly takes the columns and environment as references rather than values, and those both need to be put on the stack beforehand. Also, all the colours are now hidden behind an `opts` field, so a lot of the rendering code is more verbose too (but not greatly so).
      7f980935
  10. 17 12月, 2015 3 次提交
    • B
      Rename cell 'length' to 'width' · 39aa2104
      Benjamin Sago 提交于
      Because, strictly speaking, it's not a length, it's a width!
      
      Also, re-order some struct constructors so that they're no longer
      order-dependent (it's no longer the case that a value will be borrowed for one
      field then consumed in another, meaning they have to be ordered in a certain
      way to compile. Now the value is just worked out beforehand and the fields can
      be specified in any order)
      39aa2104
    • B
      Encapsulate "display width" in a struct · 4c2bf2f2
      Benjamin Sago 提交于
      This commit introduces the `output::cell::DisplayWidth` struct, which
      encapsulates the Unicode *display width* of a string in a struct that makes it
      less easily confused with the *length* of a string.
      
      The use of this type means that it's now harder to accidentally use a string's
      length-in-bytes as its width. I've fixed at least one case in the code where
      this was being done!
      
      The only casualty is that it introduces a dependency on the output module from
      the file module, which will be removed next commit.
      4c2bf2f2
    • B
      Replace Cells with growable TextCells · c911b5f6
      Benjamin Sago 提交于
      A recent change to ansi-term [1] means that `ANSIString`s can now hold either
      owned *or* borrowed data (Rust calls this the Cow type). This means that we
      can delay formatting ANSIStrings into ANSI-control-code-formatted strings
      until it's absolutely necessary. The process for doing this was:
      
      1. Replace the `Cell` type with a `TextCell` type that holds a vector of
         `ANSIString` values instead of a formatted string. It still does the
         width tracking.
      
      2. Rework the details module's `render` functions to emit values of this
         type.
      
      3. Similarly, rework the functions that produce cells containing filenames
         to use a `File` value's `name` field, which is an owned `String` that
         can now be re-used.
      
      4. Update the printing, formatting, and width-calculating code in the
         details and grid-details views to produce a table by adding vectors
         together instead of adding strings together, delaying the formatting as
         long as it can.
      
      This results in fewer allocations (as fewer `String` values are produced), and
      makes the API tidier (as fewer `String` values are being passed around without
      having their contents specified).
      
      This also paves the way to Windows support, or at least support for
      non-ANSI terminals: by delaying the time until strings are formatted,
      it'll now be easier to change *how* they are formatted.
      
      Casualties include:
      
      - Bump to ansi_term v0.7.1, which impls `PartialEq` and `Debug` on
        `ANSIString`.
      - The grid_details and lines views now need to take a vector of files, rather
        than a borrowed slice, so the filename cells produced now own the filename
        strings that get taken from files.
      - Fixed the signature of `File#link_target` to specify that the
        file produced refers to the same directory, rather than some phantom
        directory with the same lifetime as the file. (This was wrong from the
        start, but it broke nothing until now)
      
      References:
      
      [1]: ansi-term@f6a6579ba8174de1cae64d181ec04af32ba2a4f0
      c911b5f6
  11. 15 11月, 2015 1 次提交
    • B
      Move many Options structs to the output module · 10468797
      Ben S 提交于
      This cleans up the options module, moving the structs that were *only* in use for the columns view out of it.
      
      The new OptionSet trait is used to add the ‘deduce’ methods that used to be present on the values.
      10468797
  12. 26 8月, 2015 2 次提交
    • B
      Restore xattrs to their long view column · 5e1ff9cd
      Ben S 提交于
      Had to thread the value in at display-time to get it to only query the attributes once!
      
      This isn't the nicest way to do it, but this *is* a bit of an edge-case (it's the only thing where a column depends on something that gets calculated later)
      5e1ff9cd
    • B
      Print xattrs in tree view like we do errors · 69b22a0d
      Ben S 提交于
      This changes the way extended attributes (xattrs) are printed. Before, they were artificially printed out on their own line both in lines mode *and* details mode, which looked a bit weird. Now, they are additional 'child nodes' of that item that get printed alongside errors.
      
      All this allows all the 'extra info' that is going to be present for very few entries to be consolidated and listed in the same way, without resorting to extra printlns.
      
      As a great side-effect, it allows taking out some of the more redundant code in the Table impl -- it is now *always* going to be in create-child-nodes mode, as *any* file now can, not only when we have the --tree flag in use.
      
      Also, it now actually displays errors when failing to read the extended attributes, such as if the user doesn't have permission to read them.
      
      The extended attribute flag has been temporarily disabled while I work out the best way to do it!
      69b22a0d
  13. 03 8月, 2015 1 次提交
    • B
      Allow --tree without --long · e1f4ea92
      Ben S 提交于
      This kind of abuses the details view by giving it no columns when the Columns value is None (it's now Optional).
      e1f4ea92
  14. 16 7月, 2015 1 次提交
    • B
      Updates for term-grid · d710151e
      Ben S 提交于
      The separator_width field in the term_grid crate was replaced with a filling field.
      d710151e
  15. 29 6月, 2015 5 次提交
  16. 28 6月, 2015 2 次提交
    • B
      Adapt the long grid view to the console width · 08f3514d
      Ben S 提交于
      08f3514d
    • B
      Add --grid --long option · ccdf9ff4
      Ben S 提交于
      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.
      ccdf9ff4