diff options
author | Blaž Hrastnik | 2021-06-03 01:28:49 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-06-03 01:28:49 +0000 |
commit | c0332bd935bb7c016278d43a526e588558a0cab1 (patch) | |
tree | d7a65b8aef3bde84baa7a39196a089e203f95d2a /helix-term/src/ui/prompt.rs | |
parent | 3c7729906c9a677d715f2694c16cd78200691aaf (diff) |
Fix split sizes getting out of sync with the terminal size, refs #69
Diffstat (limited to 'helix-term/src/ui/prompt.rs')
-rw-r--r-- | helix-term/src/ui/prompt.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs index 8bb6ba93..1f424878 100644 --- a/helix-term/src/ui/prompt.rs +++ b/helix-term/src/ui/prompt.rs @@ -160,7 +160,13 @@ impl Prompt { if let Some(doc) = (self.doc_fn)(&self.line) { let text = ui::Text::new(doc.to_string()); - let area = Rect::new(completion_area.x, completion_area.y - 3, BASE_WIDTH * 3, 3); + let viewport = area; + let area = viewport.intersection(Rect::new( + completion_area.x, + completion_area.y - 3, + BASE_WIDTH * 3, + 3, + )); let background = theme.get("ui.help"); surface.clear_with(area, background); |