From 36e328497908159af5e4240457e6501d849f9e60 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Fri, 15 Oct 2021 11:12:26 +0200 Subject: [PATCH] help: ensure there is a blank line between title bar and start of text In olden times, each help text started with a title line in the text window followed by a blank line. But since version 2.8.2, since the help texts have become almost regular buffers (and thus searchable), the title of the help text is in the title bar, and since version 4.0, since --morespace became the default, the text will start immediately below it. But a title line immediately followed by text, without a blank line between them, does not look nice. So, add such a blank line back when not using --emptyline (and also when using --minibar, because the top of the terminal window is like a title bar). --- src/help.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/help.c b/src/help.c index c0c8d03b..2b8476a9 100644 --- a/src/help.c +++ b/src/help.c @@ -323,6 +323,13 @@ void wrap_help_text_into_buffer(void) make_new_buffer(); + /* Ensure there is a blank line at the top of the text, for esthetics. */ + if (ISSET(MINIBAR) || !ISSET(EMPTY_LINE)) { + openfile->current->data = mallocstrcpy(openfile->current->data, " "); + openfile->current->next = make_new_node(openfile->current); + openfile->current = openfile->current->next; + } + /* Copy the help text into the just-created new buffer. */ while (*ptr != '\0') { int length, shim;