@@ -116,18 +116,18 @@ impl Prompt {
116116 let max_col = area.width / BASE_WIDTH;
117117 let col_height = ((self.completion.len() as u16 + max_col - 1) / max_col);
118118
119− for i in (3..col_height + 3) {
120− surface.set_string(
121− 0,
122− area.height - i as u16,
123− " ".repeat(area.width as usize),
124− text_color,
125− );
119+ // completion box area
120+ let area = Rect::new(area.x, area.height - col_height - 2, area.width, col_height);
121+ let background = theme.get("ui.statusline");
122+
123+ for y in area.top()..area.bottom() {
124+ for x in area.left()..area.right() {
125+ let cell = surface.get_mut(x, y);
126+ cell.reset();
127+ cell.set_style(background);
128+ }
126129 }
127− surface.set_style(
128− Rect::new(0, area.height - col_height - 2, area.width, col_height),
129− theme.get("ui.statusline"),
130− );
130+
131131 for (i, (_range, completion)) in self.completion.iter().enumerate() {
132132 let color = if Some(i) == self.completion_selection_index {
133133 Style::default().bg(Color::Rgb(104, 60, 232))
@@ -135,14 +135,14 @@ impl Prompt {
135135 text_color
136136 };
137137 surface.set_stringn(
138− 1 + col * BASE_WIDTH,
139− area.height - col_height - 2 + row,
138+ area.x + 1 + col * BASE_WIDTH,
139+ area.y + row,
140140 &completion,
141141 BASE_WIDTH as usize - 1,
142142 color,
143143 );
144144 row += 1;
145− if row > col_height - 1 {
145+ if row > area.height - 1 {
146146 row = 0;
147147 col += 1;
148148 }