fix(expand): clear line before printing option
This commit is contained in:
parent
c454826c25
commit
e551d19f95
|
@ -11,6 +11,7 @@ use ui::{
|
|||
use super::{Choice, Transform};
|
||||
use crate::{Answer, Answers, ExpandItem};
|
||||
pub use builder::ExpandBuilder;
|
||||
use ui::backend::ClearType;
|
||||
|
||||
mod builder;
|
||||
|
||||
|
@ -29,6 +30,7 @@ impl Widget for ExpandText {
|
|||
layout: &mut ui::layout::Layout,
|
||||
backend: &mut B,
|
||||
) -> io::Result<()> {
|
||||
backend.clear(ClearType::CurrentLine)?;
|
||||
self.text.render(layout, backend)
|
||||
}
|
||||
|
||||
|
@ -158,6 +160,7 @@ impl<F: Fn(char) -> Option<char>> ui::Widget for ExpandPrompt<'_, F> {
|
|||
}
|
||||
None => {
|
||||
layout.offset_y += 1;
|
||||
b.clear(ClearType::CurrentLine)?;
|
||||
b.write_all(b"Help, list all options")?;
|
||||
b.move_cursor(MoveDirection::NextLine(1))?;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue