From 4b6bf2141459caf628f952678bf886a18927d8d2 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 13 Nov 2021 04:36:45 -0500 Subject: highlight the focused entry --- src/readline.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/readline.rs') diff --git a/src/readline.rs b/src/readline.rs index 8d7a87f..11ea2dd 100644 --- a/src/readline.rs +++ b/src/readline.rs @@ -59,9 +59,15 @@ impl Readline { pub async fn render( &self, out: &mut textmode::Output, + focus: bool, ) -> anyhow::Result<()> { out.move_to(self.size.0 - 1, 0); + if focus { + out.set_fgcolor(textmode::color::BLACK); + out.set_bgcolor(textmode::color::CYAN); + } out.write_str(&self.prompt); + out.reset_attributes(); out.write_str(&self.input_line); out.move_to(self.size.0 - 1, self.prompt_width() + self.pos_width()); Ok(()) -- cgit v1.2.3-54-g00ecf