-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Crash in parser when backspacing over variable name #9826
Copy link
Copy link
Closed
Labels
A:parserIssues related to parsingIssues related to parsingcategory:bugSomething isn't workingSomething isn't workingdeprecated:duplicate(deprecated: use GitHub's "close as duplicate" feature) This issue is a duplicate of another issue(deprecated: use GitHub's "close as duplicate" feature) This issue is a duplicate of another issuepanic
Milestone
Description
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
xinlet 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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A:parserIssues related to parsingIssues related to parsingcategory:bugSomething isn't workingSomething isn't workingdeprecated:duplicate(deprecated: use GitHub's "close as duplicate" feature) This issue is a duplicate of another issue(deprecated: use GitHub's "close as duplicate" feature) This issue is a duplicate of another issuepanic