nushell/crates/nu-explore
Solomon 071faae772
fix inspect and explore panics on empty records (#13893)
# Description

Fixes a couple panics:

```
> {} | inspect
Error:   x Main thread panicked.
  |-> at crates/nu-command/src/debug/inspect_table.rs:87:15
  `-> attempt to divide by zero
```

```
> {} | explore
# see an empty column, press Down
Error:   x Main thread panicked.
  |-> at crates/nu-explore/src/views/cursor/mod.rs:39:9
  `-> attempt to subtract with overflow
```

# User-Facing Changes

`{} | inspect` now outputs an empty table:

```
╭─────────────┬────────╮
│ description │ record │
├─────────────┴────────┤
│                      │
├──────────────────────┤
```

`{} | explore` opens the help menu.

Both match the empty list behavior.

# Tests

I'm not sure how to test `explore`, as it waits for interaction.
2024-09-25 07:48:16 -05:00
..
src fix inspect and explore panics on empty records (#13893) 2024-09-25 07:48:16 -05:00
.gitignore [MVP][WIP] less like pager (#6984) 2022-12-01 09:32:10 -06:00
Cargo.toml Bump version to 0.98.1 (#13896) 2024-09-22 12:41:44 +08:00
LICENSE Fix rest of license year ranges (#8727) 2023-04-04 09:03:29 +12:00
README.md Add top-level crate documentation/READMEs (#12907) 2024-07-14 10:10:41 +02:00

Implementation of the interactive explore command pager.

Internal Nushell crate

This crate implements components of Nushell and is not designed to support plugin authors or other users directly.