nushell/crates/nu-command/src
Wind c150af4279
Don't panic on detect columns with --guess flag (#13752)
# Description
This pr addresses the comment:
https://github.com/nushell/nushell/issues/11791#issuecomment-2308384155

It's caused by if the last row have a very different format to the first
row, the value of `end_char` will exceed the `line_char_boundaries`.
Adding a guard for it should avoid such panic.

# User-Facing Changes
The following code should no longer panic:
```shell
"nu_plugin_highlight = '1.2.2+0.97.1'    # A nushell plugin for syntax highlighting
trace_nu_plugin = '0.3.1'               # A wrapper to trace Nu plugins
nu_plugin_bash_env = '0.13.0'           # Nu plugin bash-env
nu_plugin_from_sse = '0.4.0'            # Nushell plugin to convert a HTTP server sent event stream to structured data
... and 90 crates more (use --limit N to see more)" | detect columns -n --guess
```

# Tests + Formatting
Added 1 test.
2024-09-02 16:29:53 +02:00
..
bytes Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
charting doc: fix broken doc links (#13644) 2024-08-23 21:17:44 +02:00
conversions Add split cell-path (#13705) 2024-08-28 23:01:26 +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 [DRAFT] Check fix for emojie, wrap issues (#13430) 2024-08-23 17:35:42 -05:00
env Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
experimental Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
filesystem Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
filters Make tee work more nicely with non-collections (#13652) 2024-09-01 19:03:46 +02:00
formats Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
generators Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
hash Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
help Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
math Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
misc Changed category for panic and added search terms and examples (#13707) 2024-08-27 16:58:05 -07:00
network Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
path Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
platform Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
random Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02: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 Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
strings Don't panic on detect columns with --guess flag (#13752) 2024-09-02 16:29:53 +02:00
system doc: fix broken doc links (#13644) 2024-08-23 21:17:44 +02:00
viewers Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
default_context.rs Add split cell-path (#13705) 2024-08-28 23:01:26 +02: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 Add derive macros for FromValue and IntoValue to ease the use of Values in Rust code (#13031) 2024-06-17 16:05:11 -07:00