diff --git a/helix-term/src/ui/popup.rs b/helix-term/src/ui/popup.rs index 3c140da40aef3..8e276ee2d883a 100644 --- a/helix-term/src/ui/popup.rs +++ b/helix-term/src/ui/popup.rs @@ -220,14 +220,23 @@ impl Component for Popup { let (rel_x, rel_y) = self.get_rel_position(viewport, cx); // clip to viewport - let area = viewport.intersection(Rect::new(rel_x, rel_y, self.size.0, self.size.1)); + let mut area = viewport.intersection(Rect::new(rel_x, rel_y, self.size.0, self.size.1)); // clear area let background = cx.editor.theme.get("ui.popup"); surface.clear_with(area, background); - let inner = area.inner(&self.margin); - self.contents.render(inner, surface, cx); + if cx.editor.config().popup_frame { + tui::widgets::Widget::render( + tui::widgets::Block::default().borders(tui::widgets::Borders::ALL), + area, + surface, + ); + } else { + area = area.inner(&self.margin); + } + + self.contents.render(area, surface, cx); } fn id(&self) -> Option<&'static str> { diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index 60b3880c6e14b..2a5ef2645c275 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -170,6 +170,8 @@ pub struct Config { pub indent_guides: IndentGuidesConfig, /// Whether to color modes with different colors. Defaults to `false`. pub color_modes: bool, + /// Draw frame around popups. + pub popup_frame: bool, } #[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] @@ -605,6 +607,7 @@ impl Default for Config { bufferline: BufferLine::default(), indent_guides: IndentGuidesConfig::default(), color_modes: false, + popup_frame: false, } } }