@@ -5,6 +5,7 @@ use helix_view::input::KeyEvent;
5use helix_view::keyboard::{KeyCode, KeyModifiers};
5use helix_view::keyboard::{KeyCode, KeyModifiers};
6use std::{borrow::Cow, ops::RangeFrom};
6use std::{borrow::Cow, ops::RangeFrom};
7use tui::buffer::Buffer as Surface;
7use tui::buffer::Buffer as Surface;
8+use tui::widgets::{Block, Borders, Widget};
9use helix_core::{
10use helix_core::{
10 unicode::segmentation::GraphemeCursor, unicode::width::UnicodeWidthStr, Position,
11 unicode::segmentation::GraphemeCursor, unicode::width::UnicodeWidthStr, Position,
@@ -26,7 +27,7 @@ pub struct Prompt {
26 history_pos: Option<usize>,
27 history_pos: Option<usize>,
27 completion_fn: Box<dyn FnMut(&Editor, &str) -> Vec<Completion>>,
28 completion_fn: Box<dyn FnMut(&Editor, &str) -> Vec<Completion>>,
28 callback_fn: Box<dyn FnMut(&mut Context, &str, PromptEvent)>,
29 callback_fn: Box<dyn FnMut(&mut Context, &str, PromptEvent)>,
29− pub doc_fn: Box<dyn Fn(&str) -> Option<&'static str>>,
30+ pub doc_fn: Box<dyn Fn(&str) -> Option<Cow<str>>>,
32#[derive(Clone, Copy, PartialEq)]
33#[derive(Clone, Copy, PartialEq)]
@@ -406,14 +407,18 @@ impl Prompt {
406 let background = theme.get("ui.help");
407 let background = theme.get("ui.help");
407 surface.clear_with(area, background);
408 surface.clear_with(area, background);
409− text.render(
410+ let block = Block::default()
411+ // .title(self.title.as_str())
412+ .borders(Borders::ALL)
413+ .border_style(background);
410− area.inner(&Margin {
415+ let inner = block.inner(area).inner(&Margin {
411− vertical: padding,
416+ vertical: 0,
412− horizontal: padding,
417+ horizontal: 1,
420+ block.render(area, surface);
414− surface,
421+ text.render(inner, surface, cx);
419 let line = area.height - 1;
424 let line = area.height - 1;