tweaks: rename two variables, to be less cryptic

master
Benno Schulenberg 2019-04-30 13:40:56 +02:00
parent fa21986ecf
commit e5831f81bb
1 changed files with 10 additions and 11 deletions

View File

@ -276,9 +276,9 @@ void cut_to_eof(void)
void do_cut_text(bool copy_text, bool marked, bool cut_till_eof, bool append) void do_cut_text(bool copy_text, bool marked, bool cut_till_eof, bool append)
{ {
#ifndef NANO_TINY #ifndef NANO_TINY
linestruct *cb_save = NULL; linestruct *was_bottom = NULL;
/* The current end of the cutbuffer, before we add text to it. */ /* The current end of the cutbuffer, before we add text to it. */
size_t cb_save_len = 0; size_t botlen = 0;
/* The length of the string at the current end of the cutbuffer, /* The length of the string at the current end of the cutbuffer,
* before we add text to it. */ * before we add text to it. */
bool using_magicline = !ISSET(NO_NEWLINES); bool using_magicline = !ISSET(NO_NEWLINES);
@ -299,8 +299,8 @@ void do_cut_text(bool copy_text, bool marked, bool cut_till_eof, bool append)
if (copy_text) { if (copy_text) {
/* If the cutbuffer isn't empty, remember where it currently ends. */ /* If the cutbuffer isn't empty, remember where it currently ends. */
if (cutbuffer != NULL) { if (cutbuffer != NULL) {
cb_save = cutbottom; was_bottom = cutbottom;
cb_save_len = strlen(cutbottom->data); botlen = strlen(cutbottom->data);
} }
/* Don't add a magic line when moving text to the cutbuffer. */ /* Don't add a magic line when moving text to the cutbuffer. */
SET(NO_NEWLINES); SET(NO_NEWLINES);
@ -323,14 +323,13 @@ void do_cut_text(bool copy_text, bool marked, bool cut_till_eof, bool append)
#ifndef NANO_TINY #ifndef NANO_TINY
if (copy_text) { if (copy_text) {
/* Copy the text that is in the cutbuffer (starting at its saved end, /* Copy the text that was put into the cutbuffer back into the current
* if there is one) back into the current buffer. This effectively * file buffer, so that in the end nothing has been deleted. */
* uncuts the text we just cut. */
if (cutbuffer != NULL) { if (cutbuffer != NULL) {
if (cb_save != NULL) { if (was_bottom != NULL) {
cb_save->data += cb_save_len; was_bottom->data += botlen;
copy_from_buffer(cb_save); copy_from_buffer(was_bottom);
cb_save->data -= cb_save_len; was_bottom->data -= botlen;
} else } else
copy_from_buffer(cutbuffer); copy_from_buffer(cutbuffer);