From e01651cde18cf75dd0e58b40408c8b6d8ed730f4 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 19 Jan 2020 19:55:22 +0100 Subject: [PATCH] pasting: retain the mark's position when it was set at the cursor When the mark is set at the current cursor position, and then something is pasted (either with ^U or from outside of nano), then this entire pasted text should be marked -- just like when it had been typed. So, the mark's position should not be adjusted not only when it is located before the cursor but also when it is at the same place as the cursor. This fixes https://savannah.gnu.org/bugs/?57631. Bug existed since version 2.0.7. --- src/cut.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cut.c b/src/cut.c index d7066c13..10e2d672 100644 --- a/src/cut.c +++ b/src/cut.c @@ -307,7 +307,7 @@ void ingraft_buffer(linestruct *topline) bool same_line = (openfile->mark == openfile->current); bool right_side_up = (openfile->mark && (openfile->mark->lineno < openfile->current->lineno || - (same_line && openfile->mark_x < openfile->current_x))); + (same_line && openfile->mark_x <= openfile->current_x))); #endif /* Partition the buffer so that it contains no text, then delete it.*/