From 6e050f5634031c1bdcc5b79ab34e8ed9a69fd08e Mon Sep 17 00:00:00 2001 From: Reilly Wood <26268125+rgwood@users.noreply.github.com> Date: Mon, 20 May 2024 13:03:21 -0700 Subject: [PATCH] `explore`: consolidate padding config, handle ByteStream, tweak naming+comments (#12915) Some minor changes to `explore`, continuing on my mission to simplify the command in preparation for a larger UX overhaul: 1. Consolidate padding configuration. I don't think we need separate config points for the (optional) index column and regular data columns in the normal pager, they can share padding configuration. Likewise, in the binary viewer all 3 columns (index, data, ASCII) had their left+right padding configured independently. 2. Update `explore` so we use the binary viewer for the new `ByteStream` type. `cat foo.txt | into binary | explore` was not using the binary viewer after the `ByteStream` changes. 3. Tweak the naming of a few helper functions, add a comment I've put the changes in separate commits to make them easier to review. --------- Co-authored-by: Stefan Holderbach --- crates/nu-explore/src/commands/table.rs | 12 --- crates/nu-explore/src/lib.rs | 14 ++- .../src/views/binary/binary_widget.rs | 75 ++++++--------- crates/nu-explore/src/views/binary/mod.rs | 17 +--- crates/nu-explore/src/views/record/mod.rs | 26 ++--- crates/nu-explore/src/views/record/tablew.rs | 96 ++++++++++--------- 6 files changed, 98 insertions(+), 142 deletions(-) diff --git a/crates/nu-explore/src/commands/table.rs b/crates/nu-explore/src/commands/table.rs index 7b778a8971..39ef8f0f99 100644 --- a/crates/nu-explore/src/commands/table.rs +++ b/crates/nu-explore/src/commands/table.rs @@ -25,8 +25,6 @@ struct TableSettings { selected_column_s: Option