reedline: Problems with input requiring more lines than available in the terminal window screen

using engine-q, i was testing out pasting json and was presented with this panic.

this is the json i pasted.

{
  "name": "inc",
  "usage": "Increment a value or version. Optionally use the column of a table.",
  "extra_usage": "",
  "required_positional": [],
  "optional_positional": [],
  "rest_positional": {
    "name": "",
    "desc": "",
    "shape": "Any",
    "var_id": null
  },
  "named": [
    {
      "long": "help",
      "short": "h",
      "arg": null,
      "required": false,
      "desc": "Display this help message",
      "var_id": null
    },
    {
      "long": "major",
      "short": "M",
      "arg": null,
      "required": false,
      "desc": "increment the major version (eg 1.2.1 -> 2.0.0)",
      "var_id": null
    },
    {
      "long": "minor",
      "short": "m",
      "arg": null,
      "required": false,
      "desc": "increment the minor version (eg 1.2.1 -> 1.3.0)",
      "var_id": null
    },
    {
      "long": "patch",
      "short": "p",
      "arg": null,
      "required": false,
      "desc": "increment the patch version (eg 1.2.1 -> 1.2.2)",
      "var_id": null
    }
  ],
  "is_filter": false,
  "creates_scope": false,
  "category": "Default"
}

this is the backtrace

thread 'main' panicked at 'attempt to subtract with overflow', /Users/fdncred/.cargo/git/checkouts/reedline-e42026a78d91c510/c11aef2/src/engine.rs:928:60
stack backtrace:
   0: rust_begin_unwind
             at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:517:5
   1: core::panicking::panic_fmt
             at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/panicking.rs:101:14
   2: core::panicking::panic
             at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/panicking.rs:50:5
   3: reedline::engine::Reedline::wrap
             at /Users/fdncred/.cargo/git/checkouts/reedline-e42026a78d91c510/c11aef2/src/engine.rs:928:60
   4: reedline::engine::Reedline::run_edit_commands
             at /Users/fdncred/.cargo/git/checkouts/reedline-e42026a78d91c510/c11aef2/src/engine.rs:822:25
   5: reedline::engine::Reedline::handle_editor_event
             at /Users/fdncred/.cargo/git/checkouts/reedline-e42026a78d91c510/c11aef2/src/engine.rs:600:21
   6: reedline::engine::Reedline::handle_event
             at /Users/fdncred/.cargo/git/checkouts/reedline-e42026a78d91c510/c11aef2/src/engine.rs:421:13
   7: reedline::engine::Reedline::read_line_helper
             at /Users/fdncred/.cargo/git/checkouts/reedline-e42026a78d91c510/c11aef2/src/engine.rs:406:39
   8: reedline::engine::Reedline::read_line
             at /Users/fdncred/.cargo/git/checkouts/reedline-e42026a78d91c510/c11aef2/src/engine.rs:315:22
   9: engine_q::main
             at ./src/main.rs:269:25
  10: core::ops::function::FnOnce::call_once
             at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.```

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 21 (14 by maintainers)

Most upvoted comments

if it worked identically to fish, I’d be pleased. 😃