From 12ea4e7f6005e6662c479279df9061f01eb9bcc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hilmar=20G=C3=BAstafsson?= Date: Tue, 21 Jul 2020 07:47:26 +0200 Subject: [PATCH] launcher: draw cursor for calc and shell modes --- src/widgets/launcher.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/widgets/launcher.rs b/src/widgets/launcher.rs index b2ff02d..d0217ab 100644 --- a/src/widgets/launcher.rs +++ b/src/widgets/launcher.rs @@ -139,11 +139,12 @@ impl<'a> Launcher<'a> { + self.font_size / 4; let x_off = if !self.input.is_empty() { - let dim = self.font.borrow_mut().auto_draw_text( + let dim = self.font.borrow_mut().auto_draw_text_with_cursor( &mut buf.offset((x_off, 0))?, bg, &Color::new(1.0, 1.0, 1.0, 1.0), &self.input[1..], + self.cursor - 1, )?; x_off + dim.0 + self.font_size / 4 @@ -177,11 +178,12 @@ impl<'a> Launcher<'a> { + self.font_size / 4; if !self.input.is_empty() { - self.font.borrow_mut().auto_draw_text( + self.font.borrow_mut().auto_draw_text_with_cursor( &mut buf.offset((x_off, 0))?, bg, &Color::new(1.0, 1.0, 1.0, 1.0), &self.input[1..], + self.cursor - 1, )?; };