markdown.cc: Format

Slightly custom because the automated formatting messes up the
braced initializer with named fields.
This commit is contained in:
Robert Hensing 2024-07-23 16:57:45 +02:00
parent fb450de20e
commit 2b4e3f04a4

View file

@ -4,8 +4,8 @@
#include "terminal.hh" #include "terminal.hh"
#if HAVE_LOWDOWN #if HAVE_LOWDOWN
# include <sys/queue.h> # include <sys/queue.h>
# include <lowdown.h> # include <lowdown.h>
#endif #endif
namespace nix { namespace nix {
@ -15,7 +15,8 @@ std::string renderMarkdownToTerminal(std::string_view markdown)
#if HAVE_LOWDOWN #if HAVE_LOWDOWN
int windowWidth = getWindowSize().second; int windowWidth = getWindowSize().second;
struct lowdown_opts opts { struct lowdown_opts opts
{
.type = LOWDOWN_TERM, .type = LOWDOWN_TERM,
.maxdepth = 20, .maxdepth = 20,
.cols = (size_t) std::max(windowWidth - 5, 60), .cols = (size_t) std::max(windowWidth - 5, 60),