commit e01651cde18cf75dd0e58b40408c8b6d8ed730f4
parent 12cf1c99801eb382b4a2274059ebf2de22975a07
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Sun, 19 Jan 2020 19:55:22 +0100
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.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git 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.*/