nushell/crates/nu-command/src
Douglas 74bd0e32cc
ansi -l includes previews of attributes (e.g., bold, dimmed, blink, etc.) (#14196)
# Description

A few simple changes:

* Extends the range of previews to include the attributes - Bold,
italic, underline, etc.
* Also resets the colors before *every* preview. Previously we weren't
doing this, so the "string" theme color was bleeding into a few previews
(mostly, if not all, `bg` ones). Now the "default foreground" color is
used for any preview without an explicit foreground color.
* Moves the preview code into the `if use_ansi_coloring` block as a
stupid-nitpick optimization. There's no reason to populate the previews
when they are explicitly not shown with `use_ansi_coloring: false`.
* Moves `reset` to the bottom of the attribute list so that it isn't
previewed. This is a bit of a nitpick as well since internally we send
the same code for both a `reset` and `attr_normal` (which is correct),
but semantically a `reset` doesn't seem like a "previewable" thing,
whereas "normal" text can be demonstrated with a preview.

# User-Facing Changes

`ansi -l` now shows additional previews

# Tests + Formatting

- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- 🟢 `toolkit test`
- 🟢 `toolkit test stdlib`

# After Submitting

N/A
2024-10-29 09:14:54 -05:00
..
bytes Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
charting Replace raw usize IDs with new types (#13832) 2024-09-30 13:20:15 +02:00
conversions run ensure_flag_arg_type for short flag values (#14074) 2024-10-20 23:12:57 +02:00
database Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
date Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
debug Reduce duplicate dependencies on the windows crate (#14105) 2024-10-20 23:14:11 +02:00
env Reduce duplication in history path construction (#13475) 2024-10-11 07:51:50 -05:00
experimental Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
filesystem Add metadata on open --raw with bytestreams (#14141) 2024-10-23 16:50:15 -05:00
filters support table literal syntax in join right-table argument (#14190) 2024-10-29 06:37:44 -05:00
formats make adding newlines with to text more consistent and opt-out-able (#14158) 2024-10-23 16:49:51 -05:00
generators Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
hash add binary as input to hash commands (#13923) 2024-09-25 16:47:52 +08:00
help add is_const to help commands and scope commands (#14125) 2024-10-21 12:54:18 +02:00
math Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
misc Replace raw usize IDs with new types (#13832) 2024-09-30 13:20:15 +02:00
network provide a common implementation for query string conversions in url join and url build-query (#14173) 2024-10-29 06:33:14 -05:00
path fix path exists on a non-directory file (#13763) 2024-09-11 12:45:39 -05:00
platform ansi -l includes previews of attributes (e.g., bold, dimmed, blink, etc.) (#14196) 2024-10-29 09:14:54 -05:00
random support filesize arguments in random binary/chars (#14068) 2024-10-12 14:49:05 +08:00
removed Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
shells Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
stor feat: stor insert accepts lists (#14175) 2024-10-29 06:32:55 -05:00
strings allow oem code pages to be used to decode text (#14187) 2024-10-29 06:32:35 -05:00
system add command_type to help (#14165) 2024-10-24 19:06:49 +02:00
viewers Introduce footer_inheritance option (#14070) 2024-10-23 19:45:47 +02:00
default_context.rs Remove group command (#14056) 2024-10-11 06:43:12 -05:00
example_test.rs Overhaul $in expressions (#13357) 2024-07-17 16:02:42 -05:00
lib.rs Add top-level crate documentation/READMEs (#12907) 2024-07-14 10:10:41 +02:00
progress_bar.rs Replace ExternalStream with new ByteStream type (#12774) 2024-05-16 07:11:18 -07:00
sort_utils.rs Rework sorting and add cell path and closure comparators to sort-by (#13154) 2024-10-09 19:18:16 -07:00