diff --git a/src/nano.h b/src/nano.h index 71112fac..de1fca19 100644 --- a/src/nano.h +++ b/src/nano.h @@ -630,7 +630,7 @@ enum #define WAS_WHOLE_LINE (1<<2) #define INCLUDED_LAST_LINE (1<<3) #define MARK_WAS_SET (1<<4) -#define WAS_MARKED_FORWARD (1<<5) +#define WAS_MARKED_BACKWARDS (1<<5) #endif /* !NANO_TINY */ /* The default number of columns from end of line where wrapping occurs. */ diff --git a/src/text.c b/src/text.c index f700fea8..7ece57ba 100644 --- a/src/text.c +++ b/src/text.c @@ -479,7 +479,7 @@ void undo_cut(undostruct *u) openfile->filebot->prev->data[0] == '\0') remove_magicline(); - if (!(u->xflags & WAS_MARKED_FORWARD) && u->type != PASTE) + if (u->xflags & WAS_MARKED_BACKWARDS) goto_line_posx(u->head_lineno, u->head_x); } @@ -1187,8 +1187,8 @@ void add_undo(undo_type action, const char *message) openfile->mark_x < openfile->current_x)) { u->head_lineno = openfile->mark->lineno; u->head_x = openfile->mark_x; - u->xflags |= WAS_MARKED_FORWARD; } else { + u->xflags |= WAS_MARKED_BACKWARDS; u->tail_lineno = openfile->mark->lineno; u->tail_x = openfile->mark_x; }