From 2275575575ea17d9428ec98f90b38751eea34d01 Mon Sep 17 00:00:00 2001 From: Jonathan Turner Date: Tue, 12 May 2020 08:06:09 +1200 Subject: [PATCH] Improve list view and ranges (#1753) --- crates/nu-cli/src/commands/autoview.rs | 7 +++++++ crates/nu-cli/src/format/table.rs | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/crates/nu-cli/src/commands/autoview.rs b/crates/nu-cli/src/commands/autoview.rs index cf1653d011..976ff5c296 100644 --- a/crates/nu-cli/src/commands/autoview.rs +++ b/crates/nu-cli/src/commands/autoview.rs @@ -176,6 +176,13 @@ pub fn autoview(context: RunnableContext) -> Result { } => { out!("{}", d); } + Value { + value: UntaggedValue::Primitive(Primitive::Range(_)), + .. + } => { + let output = format_leaf(&x).plain_string(100_000); + out!("{}", output); + } Value { value: UntaggedValue::Primitive(Primitive::Binary(ref b)), .. } => { if let Some(binary) = binary { diff --git a/crates/nu-cli/src/format/table.rs b/crates/nu-cli/src/format/table.rs index 3d05777d85..093b79ac20 100644 --- a/crates/nu-cli/src/format/table.rs +++ b/crates/nu-cli/src/format/table.rs @@ -374,7 +374,8 @@ impl RenderView for TableView { } } - let skip_headers = self.headers.len() == 2 && self.headers[1] == ""; + let skip_headers = (self.headers.len() == 2 && self.headers[1] == "") + || (self.headers.len() == 1 && self.headers[0] == ""); let header: Vec = self .headers