-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reverse search with a long prompt followed by ctrl-c causes an assertion failure panic #575
Labels
Comments
use rustyline::{Editor, Result};
fn main() -> Result<()> {
let mut rl = Editor::<()>::new();
loop {
let line = rl.readline("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>")?;
rl.add_history_entry(line.as_str());
}
} rustyline % cargo run --example minimal
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>line1
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>line2
(reverse-i-search)`e': line2 thread 'main' panicked at 'assertion failed: self.layout.cursor <= self.layout.end', /Users/gwen/Rust/rustyline/src/edit.rs:128:13 |
We try to move cursor to the end of line ( layout = {rustyline::layout::Layout}
prompt_size = {rustyline::layout::Position}
col = {usize} 35
row = {usize} 0
default_prompt = {bool} false
cursor = {rustyline::layout::Position}
col = {usize} 40 -- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>line2
row = {usize} 0
end = {rustyline::layout::Position}
col = {usize} 28 -- (reverse-i-search)`e': line2
row = {usize} 0 |
Thanks for the detailed bug report. |
Version 9.1.0 released. |
Thanks for the quick fix! It sorted out my problem. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can cause a panic with the following:
Here's the backtrace:
This is just a slightly modified version of the example.rs example:
The text was updated successfully, but these errors were encountered: