nano

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

commit b9dd572a679b61da5e4e1da89e87e76b73199c8c
parent 3fe17e0355e597a857cc1deac166ccf313a2e83b
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Sun, 28 Apr 2019 10:40:37 +0200

tweaks: set a boolean directly, instead of using a function call

Diffstat:
Msrc/nano.c | 15++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/src/nano.c b/src/nano.c @@ -398,19 +398,12 @@ void ingraft_buffer(linestruct *somebuffer) bool edittop_inside; #ifndef NANO_TINY bool right_side_up = FALSE, single_line = FALSE; -#endif -#ifndef NANO_TINY - /* Keep track of whether the mark begins inside the partition and - * will need adjustment. */ + /* Remember whether mark and cursor are on the same line, and their order. */ if (openfile->mark) { - linestruct *top, *bot; - size_t top_x, bot_x; - - mark_order((const linestruct **)&top, &top_x, - (const linestruct **)&bot, &bot_x, &right_side_up); - - single_line = (top == bot); + single_line = (openfile->mark == openfile->current); + right_side_up = (openfile->mark->lineno < openfile->current->lineno || + (single_line && openfile->mark_x < openfile->current_x)); } #endif