nano

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

commit 40a0463250d95a02dc01d883d4aabbf0645a0428
parent 187843d2da2b3c7cae5a235d589bcf9e317513cf
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Sun, 17 May 2020 11:34:22 +0200

tweaks: reshuffle an assignment, for conciseness, and rename a variable

Diffstat:
Msrc/cut.c | 12++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/cut.c b/src/cut.c @@ -347,13 +347,13 @@ void extract_segment(linestruct *top, size_t top_x, linestruct *bot, size_t bot_ * at the current cursor position. */ void ingraft_buffer(linestruct *topline) { - size_t length = strlen(openfile->current->data); + linestruct *line = openfile->current; + size_t length = strlen(line->data); size_t extralen = strlen(topline->data); size_t xpos = openfile->current_x; - char *tailtext = copy_of(openfile->current->data + xpos); - linestruct *line = openfile->current; + char *tailtext = copy_of(line->data + xpos); #ifndef NANO_TINY - bool placed_after = (openfile->mark == line && !mark_is_before_cursor()); + bool mark_follows = (openfile->mark == line && !mark_is_before_cursor()); #endif linestruct *botline = topline; @@ -401,10 +401,10 @@ void ingraft_buffer(linestruct *topline) #ifndef NANO_TINY /* When needed, update the mark's pointer and position. */ - if (placed_after && topline != botline) { + if (mark_follows && topline != botline) { openfile->mark = botline; openfile->mark_x += length - xpos; - } else if (placed_after) + } else if (mark_follows) openfile->mark_x += extralen; #endif