copied rustyline's homework
This commit is contained in:
@@ -22,11 +22,11 @@ fn get_prompt() -> ShResult<String> {
|
||||
expand_prompt(&prompt)
|
||||
}
|
||||
|
||||
pub fn read_line(edit_mode: FernEditMode) -> ShResult<String> {
|
||||
pub fn readline(edit_mode: FernEditMode) -> ShResult<String> {
|
||||
let prompt = get_prompt()?;
|
||||
let mut reader: Box<dyn Readline> = match edit_mode {
|
||||
FernEditMode::Vi => Box::new(FernVi::new(Some(prompt))?),
|
||||
FernEditMode::Vi => Box::new(FernVi::new()),
|
||||
FernEditMode::Emacs => todo!()
|
||||
};
|
||||
reader.readline()
|
||||
reader.readline(Some(prompt))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user