nano

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

commit 7ebe44ac251a66647ff8b2066296b393ba9836ce
parent 0cc2104257fb93ec2b71322b491d8672388a8399
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Sun, 29 Mar 2020 14:10:50 +0200

tweaks: rename a symbol, to be more accurate, and reshuffle two lines

Diffstat:
Msrc/nano.h | 2+-
Msrc/text.c | 8++++----
2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/nano.h b/src/nano.h @@ -627,7 +627,7 @@ enum #define WAS_WHOLE_LINE (1<<2) #define INCLUDED_LAST_LINE (1<<3) #define MARK_WAS_SET (1<<4) -#define WAS_MARKED_BACKWARDS (1<<5) +#define CURSOR_WAS_AT_HEAD (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 @@ -475,7 +475,7 @@ void undo_cut(undostruct *u) openfile->filebot->prev->data[0] == '\0') remove_magicline(); - if (u->xflags & WAS_MARKED_BACKWARDS) + if (u->xflags & CURSOR_WAS_AT_HEAD) goto_line_posx(u->head_lineno, u->head_x); } @@ -1012,19 +1012,19 @@ void add_undo(undo_type action, const char *message) break; #endif case CUT_TO_EOF: - u->xflags |= (INCLUDED_LAST_LINE | WAS_MARKED_BACKWARDS); + u->xflags |= (INCLUDED_LAST_LINE | CURSOR_WAS_AT_HEAD); break; case ZAP: case CUT: if (openfile->mark) { - u->xflags |= MARK_WAS_SET; if (mark_is_before_cursor()){ u->head_lineno = openfile->mark->lineno; u->head_x = openfile->mark_x; + u->xflags |= MARK_WAS_SET; } else { - u->xflags |= WAS_MARKED_BACKWARDS; u->tail_lineno = openfile->mark->lineno; u->tail_x = openfile->mark_x; + u->xflags |= (MARK_WAS_SET | CURSOR_WAS_AT_HEAD); } if (u->tail_lineno == openfile->filebot->lineno) u->xflags |= INCLUDED_LAST_LINE;