-
Notifications
You must be signed in to change notification settings - Fork 1
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
[readline] Ctrl-A and Ctrl-E results invalid position of cursor #2
Comments
testing with this implementation MANUALLY: use std::env;
use std::io;
use ttyui::readline::Buffer;
fn main() -> io::Result<()> {
let mut buf = Buffer::new();
buf.set_prefix("oi kitarou> ".to_string());
if let Some(x) = env::args().nth(1) {
if x == "-d" || x == "--double" {
buf.double_line_response = true;
} else {
panic!("unknown arguments");
}
}
buf.read_line()?;
println!("\n\n[output]\n\x1b[33m{}\x1b[0m", buf.to_string(),);
Ok(())
} |
It seems to be a problem caused by simple misunderstanding on prefix length handling . fixing end() and home()... |
fixed #4 |
The problem is not fixed completely. |
refixed #6 |
Cursor position after
C-A
orC-E
is invalid.For reproduction, set some prefix, input words and press
C-A
andC-E
.C-A
results bit right position than valid place. andC-E
results left side than valid one.The text was updated successfully, but these errors were encountered: