nano

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

commit 23d66949e1f32db90118d95e30be6044e9bd5cba
parent 184bb11fd9c0d12d6124c26fd7269dac45f1691c
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Sun, 24 Dec 2017 11:53:38 +0100

tweaks: frob four comments, and rewrap two lines

Diffstat:
Msrc/proto.h | 4++--
Msrc/utils.c | 22+++++++++-------------
2 files changed, 11 insertions(+), 15 deletions(-)

diff --git a/src/proto.h b/src/proto.h @@ -607,8 +607,8 @@ void new_magicline(void); void remove_magicline(void); #endif #ifndef NANO_TINY -void mark_order(const filestruct **top, size_t *top_x, const filestruct - **bot, size_t *bot_x, bool *right_side_up); +void mark_order(const filestruct **top, size_t *top_x, + const filestruct **bot, size_t *bot_x, bool *right_side_up); void get_range(const filestruct **top, const filestruct **bot); #endif size_t get_totsize(const filestruct *begin, const filestruct *end); diff --git a/src/utils.c b/src/utils.c @@ -348,8 +348,7 @@ void nperror(const char *s) } /* This is a wrapper for the malloc() function that properly handles - * things when we run out of memory. Thanks, BG, many people have been - * asking for this... */ + * things when we run out of memory. */ void *nmalloc(size_t howmuch) { void *r = malloc(howmuch); @@ -479,7 +478,7 @@ size_t strlenpt(const char *text) return span; } -/* Append a new magicline to filebot. */ +/* Append a new magicline to the end of the buffer. */ void new_magicline(void) { openfile->filebot->next = make_new_node(openfile->filebot); @@ -489,9 +488,8 @@ void new_magicline(void) } #if !defined(NANO_TINY) || defined(ENABLE_HELP) -/* Remove the magicline from filebot, if there is one and it isn't the - * only line in the file. Assume that edittop and current are not at - * filebot. */ +/* Remove the magicline from the end of the buffer, if there is one and + * it isn't the only line in the file. */ void remove_magicline(void) { if (openfile->filebot->data[0] == '\0' && @@ -505,13 +503,11 @@ void remove_magicline(void) #endif #ifndef NANO_TINY -/* Set top_x and bot_x to the top and bottom x-coordinates of the mark, - * respectively, based on the locations of top and bot. If - * right_side_up isn't NULL, set it to TRUE if the mark begins with - * (mark_begin, mark_begin_x) and ends with (current, current_x), or - * FALSE otherwise. */ -void mark_order(const filestruct **top, size_t *top_x, const filestruct - **bot, size_t *bot_x, bool *right_side_up) +/* Set (top, top_x) and (bot, bot_x) to the start and end "coordinates" of + * the marked region. If right_side_up isn't NULL, set it to TRUE when the + * mark is at the top of the marked region, and to FALSE otherwise. */ +void mark_order(const filestruct **top, size_t *top_x, + const filestruct **bot, size_t *bot_x, bool *right_side_up) { if ((openfile->current->lineno == openfile->mark->lineno && openfile->current_x > openfile->mark_x) ||