tweaks: rename a function, to be a bit more expressive
parent
72e5c15110
commit
a4eae770ce
14
src/cut.c
14
src/cut.c
|
@ -212,7 +212,7 @@ void chop_next_word(void)
|
|||
|
||||
/* Move all text between (top, top_x) and (bot, bot_x) from the current buffer
|
||||
* into the cutbuffer. */
|
||||
void extract(linestruct *top, size_t top_x, linestruct *bot, size_t bot_x)
|
||||
void extract_segment(linestruct *top, size_t top_x, linestruct *bot, size_t bot_x)
|
||||
{
|
||||
bool edittop_inside;
|
||||
#ifndef NANO_TINY
|
||||
|
@ -393,9 +393,9 @@ void cut_line(void)
|
|||
* head of this line to the head of the next line into the cutbuffer;
|
||||
* otherwise, move all of the text of this line into the cutbuffer. */
|
||||
if (openfile->current != openfile->filebot)
|
||||
extract(openfile->current, 0, openfile->current->next, 0);
|
||||
extract_segment(openfile->current, 0, openfile->current->next, 0);
|
||||
else
|
||||
extract(openfile->current, 0,
|
||||
extract_segment(openfile->current, 0,
|
||||
openfile->current, strlen(openfile->current->data));
|
||||
|
||||
openfile->placewewant = 0;
|
||||
|
@ -413,10 +413,10 @@ void cut_to_eol(void)
|
|||
* the cutbuffer. Otherwise, when not at the end of the buffer,
|
||||
* move the line separation into the cutbuffer. */
|
||||
if (openfile->current_x < data_len)
|
||||
extract(openfile->current, openfile->current_x,
|
||||
extract_segment(openfile->current, openfile->current_x,
|
||||
openfile->current, data_len);
|
||||
else if (openfile->current != openfile->filebot) {
|
||||
extract(openfile->current, openfile->current_x,
|
||||
extract_segment(openfile->current, openfile->current_x,
|
||||
openfile->current->next, 0);
|
||||
openfile->placewewant = xplustabs();
|
||||
}
|
||||
|
@ -431,7 +431,7 @@ void cut_marked(bool *right_side_up)
|
|||
get_region((const linestruct **)&top, &top_x,
|
||||
(const linestruct **)&bot, &bot_x, right_side_up);
|
||||
|
||||
extract(top, top_x, bot, bot_x);
|
||||
extract_segment(top, top_x, bot, bot_x);
|
||||
|
||||
openfile->placewewant = xplustabs();
|
||||
}
|
||||
|
@ -439,7 +439,7 @@ void cut_marked(bool *right_side_up)
|
|||
/* Move all text from the cursor position to end-of-file into the cutbuffer. */
|
||||
void cut_to_eof(void)
|
||||
{
|
||||
extract(openfile->current, openfile->current_x,
|
||||
extract_segment(openfile->current, openfile->current_x,
|
||||
openfile->filebot, strlen(openfile->filebot->data));
|
||||
}
|
||||
#endif /* !NANO_TINY */
|
||||
|
|
|
@ -258,7 +258,8 @@ void do_backspace(void);
|
|||
void chop_previous_word(void);
|
||||
void chop_next_word(void);
|
||||
#endif
|
||||
void extract(linestruct *top, size_t top_x, linestruct *bot, size_t bot_x);
|
||||
void extract_segment(linestruct *top, size_t top_x,
|
||||
linestruct *bot, size_t bot_x);
|
||||
void ingraft_buffer(linestruct *somebuffer);
|
||||
void copy_from_buffer(linestruct *somebuffer);
|
||||
#ifndef NANO_TINY
|
||||
|
|
|
@ -2050,7 +2050,7 @@ void do_justify(bool full_justify)
|
|||
|
||||
/* Do the equivalent of a marked cut into an empty cutbuffer. */
|
||||
cutbuffer = NULL;
|
||||
extract(first_par_line, top_x, last_par_line, bot_x);
|
||||
extract_segment(first_par_line, top_x, last_par_line, bot_x);
|
||||
#ifndef NANO_TINY
|
||||
update_undo(CUT);
|
||||
|
||||
|
|
Loading…
Reference in New Issue