You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the arrows to navigate history doesn't work.
Reproduction
use promkit::{preset::readline::Readline, suggest::Suggest};fnmain() -> anyhow::Result<()>{letmut p = Readline::default().enable_history().enable_suggest(Suggest::from_iter(["apple","applet","application","banana",])).prompt()?;loop{match p.run(){Ok(cmd) => {println!("result: {:?}", cmd);}Err(_) => {println!("Bye!");break;}}}Ok(())}
Additional Info
When I try to log the history, it seems like the contents section is empty and doesn't get added to.
I tried adding the text entry manually to the history:
use promkit::{preset::readline::Readline, suggest::Suggest};fnmain() -> anyhow::Result<()>{letmut p = Readline::default().enable_history().enable_suggest(Suggest::from_iter(["apple","applet","application","banana",])).prompt()?;loop{match p.run(){Ok(cmd) => {println!("result: {:?}", cmd);
p.renderer.text_editor_snapshot.after_mut().history.as_mut().unwrap().insert(cmd);}Err(_) => {println!("Bye!");break;}}}Ok(())}
This worked for a single entry (I could press the up arrow once to get the previous command) but I couldn't go any further
The text was updated successfully, but these errors were encountered:
I'm not the author, so this is just a guess, but it might be intentional.
By explicitly requesting history saving, you can customize which strings are saved and whether they are saved or not.
It might be useful to have an API like p.insert_history(cmd) because calling p.renderer...insert(cmd) is too long.
The issue with the history being cleared will be fixed in #49.
Description
Using the arrows to navigate history doesn't work.
Reproduction
Additional Info
When I try to log the history, it seems like the
contents
section is empty and doesn't get added to.I tried adding the text entry manually to the history:
This worked for a single entry (I could press the up arrow once to get the previous command) but I couldn't go any further
The text was updated successfully, but these errors were encountered: