nushell/crates/nu-explore/src
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
..
commands Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
nu_common fix inspect and explore panics on empty records (#13893) 2024-09-25 07:48:16 -05:00
pager Remove unnecessary sort in explore search fn (#13690) 2024-08-25 20:13:05 +02:00
registry Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
views explore: pass config to views at creation time (#13312) 2024-07-07 08:09:59 -05:00
default_context.rs Move explore command out of nu-command deps (#9421) 2023-06-14 01:18:36 +02:00
explore.rs Use IntoValue in config code (#13751) 2024-09-05 09:44:23 +02:00
lib.rs Add top-level crate documentation/READMEs (#12907) 2024-07-14 10:10:41 +02:00