Skip to content

Commit

Permalink
skip the popup rendering when there's no space
Browse files Browse the repository at this point in the history
  • Loading branch information
diegostafa committed Feb 6, 2024
1 parent 78ebdb3 commit a02169c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions helix-term/src/ui/prompt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,15 +393,15 @@ impl Prompt {
height,
);

if !self.completion.is_empty() {
if completion_area.height > 0 && !self.completion.is_empty() {
let area = completion_area;
let background = theme.get("ui.menu");

let items = height as usize * cols as usize;

let offset = self
.selection
.map(|selection| selection / std::cmp::max(1, items * items))
.map(|selection| selection / items * items)
.unwrap_or_default();

surface.clear_with(area, background);
Expand Down

0 comments on commit a02169c

Please sign in to comment.