aboutsummaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorJoris2022-10-09 17:46:41 +0200
committerJoris2022-10-09 17:46:41 +0200
commit76e841c740701c46969cf8cfeab94dc3cef65d9a (patch)
tree64acce7e5c34a910ba7174444caa46b81a18c0fe /src/gui
parente671d729c4ef3e9a1cfb631064192d94c77c7a55 (diff)
Show cursor only when writing
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/question.rs5
1 files changed, 4 insertions, 1 deletions
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<B: Backend>(
.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(),