mirror of
https://github.com/Llewellynvdm/exa.git
synced 2024-11-23 12:32:00 +00:00
bfb8a5a573
This commit meddles about with both the Colours and the FileExtensions. Even though all the renderable fields were turned into traits, the FileName struct kept on accessing fields directly on the Colours value instead of calling methods on it. It also did the usual amount of colour misappropriation (such as ‘punctuation’ instead of specifying ‘normal_arrow’) In preparation for when custom file colours are configurable (any day now), the colourise-file-by-kind functionality (links, sockets, or directories) was separated from the colourise-file-by-name functionality (images, videos, archives). The FileStyle struct already allowed for both to be separate; it was only changed so that a type other than FileExtensions could be used instead, as long as it implements the FileColours trait. (I feel like I should re-visit the naming of all these at some point in the future) The decision to separate the two means that FileExtensions is the one assigning the colours, rather than going through the fields on a Colours value, which have all been removed. This is why a bunch of arbitrary Styles now exist in filetype.rs. Because the decision on which colourise-file-by-name code to use (currently just the standard extensions, or nothing if we aren’t colourising) is now determined by the Colours type (instead of being derived), it’s possible to get it wrong. And wrong it was! There was a bug where file names were colourised even though the rest of the --long output wasn’t, and this wasn’t caught by the xtests. It is now.
7 lines
447 B
Plaintext
7 lines
447 B
Plaintext
ansi: [\u{1b}[34mblue\u{1b}[0m] form-feed: [\u{c}] new-line-dir: [\n]
|
||
ascii: hello invalid-utf8-1: [<5B>] new-line: [\n]
|
||
backspace: [\u{8}] invalid-utf8-2: [<5B>(] return: [\r]
|
||
bell: [\u{7}] invalid-utf8-3: [<5B>(] tab: [\t]
|
||
emoji: [🆒] invalid-utf8-4: [<5B>(<28>(] utf-8: pâté
|
||
escape: [\u{1b}] links vertical-tab: [\u{b}]
|