From 76e841c740701c46969cf8cfeab94dc3cef65d9a Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 9 Oct 2022 17:46:41 +0200 Subject: Show cursor only when writing --- src/gui/question.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gui/question.rs b/src/gui/question.rs index 95f3163..851c0af 100644 --- a/src/gui/question.rs +++ b/src/gui/question.rs @@ -75,7 +75,10 @@ pub fn ask( .alignment(Alignment::Center); f.render_widget(question, chunks[1]); - let formatted_input = format!("{}█", state.input); + let formatted_input = match state.answer { + Answer::Write => format!("{}█", state.input), + _ => state.input.clone() + }; let answer = Paragraph::new(util::center_vertically(chunks[2], &formatted_input)) .style(match state.answer { Answer::Write => Style::default(), -- cgit v1.2.3