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.
master
Benno Schulenberg 2019-05-31 19:42:44 +02:00
parent 3952dcb629
commit b52d166afa
2 changed files with 12 additions and 13 deletions

View File

@ -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

View File

@ -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 {