nano

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

commit b52d166afa80e1dc7c19eff15f5780b341d74edc
parent 3952dcb6290f62bda4523b62d65bb16c36d90257
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Fri, 31 May 2019 19:42:44 +0200

tweaks: rename a type, to make more sense

The sphere, the holder, is everything *around* the partition;
it was confusing to call this holder type 'partition'.

Also correct and improve some comments.

Diffstat:
Msrc/nano.c | 4++--
Msrc/nano.h | 21++++++++++-----------
2 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/src/nano.c b/src/nano.c @@ -49,7 +49,7 @@ #define read_them_all FALSE #endif -static partition *sphere = NULL; +static holder_type *sphere = NULL; /* Storage for rest of buffer while a piece is partitioned off. */ #ifdef ENABLE_MOUSE @@ -198,7 +198,7 @@ void renumber_from(linestruct *line) void partition_buffer(linestruct *top, size_t top_x, linestruct *bot, size_t bot_x) { - sphere = nmalloc(sizeof(partition)); + sphere = nmalloc(sizeof(holder_type)); /* If the top and bottom of the partition are different from the top * and bottom of the buffer, save the latter and then set them diff --git a/src/nano.h b/src/nano.h @@ -298,23 +298,22 @@ typedef struct linestruct { #endif } linestruct; -typedef struct partition { +typedef struct holder_type { linestruct *filetop; - /* The top line of this portion of the file. */ + /* The top line of the buffer. */ linestruct *top_prev; - /* The line before the top line of this portion of the file. */ + /* The line before the top line of the partition. */ char *top_data; - /* The text before the beginning of the top line of this portion - * of the file. */ + /* The text on the top line of the partition before the beginning + * of the partition. */ linestruct *filebot; - /* The bottom line of this portion of the file. */ + /* The bottom line of the buffer. */ linestruct *bot_next; - /* The line after the bottom line of this portion of the - * file. */ + /* The line after the bottom line of the partition. */ char *bot_data; - /* The text after the end of the bottom line of this portion of - * the file. */ -} partition; + /* The text on the bottom line of the partition after the end + * of the partition. */ +} holder_type; #ifndef NANO_TINY typedef struct undo_group {