Describe the bug
We currently crash when backspacing over the variable name in the following example:
let x = "foo" | $in; $x | describe
You get:
let xthread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', crates/nu-parser/src/parser.rs:3068:47
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
How to reproduce
- Paste
let x = "foo" | $in; $x | describe
- Move the cursor to the right of the
x in let x
- Backspace and remove the
x
Expected behavior
This should not crash
Screenshots
No response
Configuration
| key |
value |
| version |
0.83.1 |
| branch |
main |
| commit_hash |
f8d325d |
| build_os |
macos-aarch64 |
| build_target |
aarch64-apple-darwin |
| rust_version |
rustc 1.69.0 (84c898d65 2023-04-16) |
| rust_channel |
1.69.0-aarch64-apple-darwin |
| cargo_version |
cargo 1.69.0 (6e9a83356 2023-04-12) |
| build_time |
2023-07-28 05:55:14 +12:00 |
| build_rust_channel |
debug |
| allocator |
standard |
| features |
default, sqlite, trash, which, zip |
| installed_plugins |
|
Additional context
No response
Describe the bug
We currently crash when backspacing over the variable name in the following example:
You get:
How to reproduce
let x = "foo" | $in; $x | describexinlet xxExpected behavior
This should not crash
Screenshots
No response
Configuration
Additional context
No response