diff options
| author | Maxime Coste <mawww@kakoune.org> | 2019-11-22 21:48:26 +1100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2019-11-22 21:50:51 +1100 |
| commit | cb1b03c0db91d85db3545a49f68d63fad0fe137c (patch) | |
| tree | bf8ba71c18a74d8bc1ebb38df246a3b0d87ad256 /src/client.cc | |
| parent | 22d9ffa63ac22d3823c41b4671e0565a92cf8619 (diff) | |
Add support for markup in info boxes
Fixes #2552
Diffstat (limited to 'src/client.cc')
| -rw-r--r-- | src/client.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/client.cc b/src/client.cc index f4a85ccb..c4312aca 100644 --- a/src/client.cc +++ b/src/client.cc @@ -411,7 +411,7 @@ void Client::menu_hide() m_ui_pending &= ~(MenuShow | MenuSelect); } -void Client::info_show(String title, String content, BufferCoord anchor, InfoStyle style) +void Client::info_show(DisplayLine title, DisplayLineList content, BufferCoord anchor, InfoStyle style) { if (m_info.style == InfoStyle::Modal) // We already have a modal info opened, do not touch it. return; @@ -421,6 +421,15 @@ void Client::info_show(String title, String content, BufferCoord anchor, InfoSty m_ui_pending &= ~InfoHide; } +void Client::info_show(StringView title, StringView content, BufferCoord anchor, InfoStyle style) +{ + info_show({title.str(), Face{}}, + content | split<StringView>('\n') + | transform([](StringView s) { return DisplayLine{s.str(), Face{}}; }) + | gather<DisplayLineList>(), + anchor, style); +} + void Client::info_hide(bool even_modal) { if (not even_modal and m_info.style == InfoStyle::Modal) |
