ui: picker: Position count according to input bar

This commit is contained in:
Blaž Hrastnik 2021-08-13 18:00:04 +09:00
parent eb9ac0a743
commit 4167201344

View File

@ -410,6 +410,8 @@ fn render(&mut self, area: Rect, surface: &mut Surface, cx: &mut Context) {
// -- Render the input bar: // -- Render the input bar:
let area = Rect::new(inner.x + 1, inner.y, inner.width - 1, 1);
let count = format!("{}/{}", self.matches.len(), self.options.len()); let count = format!("{}/{}", self.matches.len(), self.options.len());
surface.set_stringn( surface.set_stringn(
(area.x + area.width).saturating_sub(count.len() as u16 + 1), (area.x + area.width).saturating_sub(count.len() as u16 + 1),
@ -419,7 +421,6 @@ fn render(&mut self, area: Rect, surface: &mut Surface, cx: &mut Context) {
text_style, text_style,
); );
let area = Rect::new(inner.x + 1, inner.y, inner.width - 1, 1);
self.prompt.render(area, surface, cx); self.prompt.render(area, surface, cx);
// -- Separator // -- Separator