@@ -5,6 +5,7 @@ use helix_view::input::KeyEvent;
55use helix_view::keyboard::{KeyCode, KeyModifiers};
66use std::{borrow::Cow, ops::RangeFrom};
77use tui::buffer::Buffer as Surface;
8+use tui::widgets::{Block, Borders, Widget};
89
910use helix_core::{
1011 unicode::segmentation::GraphemeCursor, unicode::width::UnicodeWidthStr, Position,
@@ -26,7 +27,7 @@ pub struct Prompt {
2627 history_pos: Option<usize>,
2728 completion_fn: Box<dyn FnMut(&Editor, &str) -> Vec<Completion>>,
2829 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>>>,
3031}
3132
3233#[derive(Clone, Copy, PartialEq)]
@@ -406,14 +407,18 @@ impl Prompt {
406407 let background = theme.get("ui.help");
407408 surface.clear_with(area, background);
408409
409− text.render(
410− area.inner(&Margin {
411− vertical: padding,
412− horizontal: padding,
413− }),
414− surface,
415− cx,
416− );
410+ let block = Block::default()
411+ // .title(self.title.as_str())
412+ .borders(Borders::ALL)
413+ .border_style(background);
414+
415+ let inner = block.inner(area).inner(&Margin {
416+ vertical: 0,
417+ horizontal: 1,
418+ });
419+
420+ block.render(area, surface);
421+ text.render(inner, surface, cx);
417422 }
418423
419424 let line = area.height - 1;