nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 36e328497908159af5e4240457e6501d849f9e60
parent 4ac932bd21070f9b1dc0eb6fc569502d151863e8
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Fri, 15 Oct 2021 11:12:26 +0200

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).

Diffstat:
Msrc/help.c | 7+++++++
1 file changed, 7 insertions(+), 0 deletions(-)

diff --git 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;