diff options
author | Blaž Hrastnik | 2021-08-13 09:00:04 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-08-13 09:00:04 +0000 |
commit | 416720134424402d02f081e6f0e4e29bbc630e1e (patch) | |
tree | ce64f35efa3fc07c9a1b62b7b68289017e071331 | |
parent | eb9ac0a743ff94e02ee4294ca342d67d1d5907c7 (diff) |
ui: picker: Position count according to input bar
-rw-r--r-- | helix-term/src/ui/picker.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs index 31aac794..08d80777 100644 --- a/helix-term/src/ui/picker.rs +++ b/helix-term/src/ui/picker.rs @@ -410,6 +410,8 @@ impl<T: 'static> Component for Picker<T> { // -- 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()); surface.set_stringn( (area.x + area.width).saturating_sub(count.len() as u16 + 1), @@ -419,7 +421,6 @@ impl<T: 'static> Component for Picker<T> { text_style, ); - let area = Rect::new(inner.x + 1, inner.y, inner.width - 1, 1); self.prompt.render(area, surface, cx); // -- Separator |