From 45fe2adf729aa1606b6e973b42cd14f895c9587f Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Wed, 18 Jun 2014 20:11:52 +0000 Subject: [PATCH] Renaming the undo type UNSPLIT to JOIN, for clarity. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4982 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 1 + src/nano.h | 2 +- src/text.c | 15 +++++++-------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 84aa125d..bd83f5c0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ with CUT_TO_END (which is about cutting to end-of-line). * src/text.c: Upon better thought, elide the unneeded 'to_eof'. * src/text.c: And elide a totally unused 'strdata2'. + * src/text.c: Rename the undo type UNSPLIT to JOIN, for clarity. 2014-06-18 Mark Majeres * src/text.c (add_undo): Don't start a new undo for CUT when the diff --git a/src/nano.h b/src/nano.h index fb2ddf44..d4d81ed4 100644 --- a/src/nano.h +++ b/src/nano.h @@ -191,7 +191,7 @@ typedef enum { #ifndef DISABLE_WRAPPING SPLIT_BEGIN, SPLIT_END, #endif - UNSPLIT, PASTE, INSERT, ENTER, OTHER + JOIN, PASTE, INSERT, ENTER, OTHER } undo_type; typedef struct color_pair { diff --git a/src/text.c b/src/text.c index 4dbaf71f..34d66a6e 100644 --- a/src/text.c +++ b/src/text.c @@ -492,7 +492,7 @@ void do_undo(void) f = openfile->current; break; #endif /* !DISABLE_WRAPPING */ - case UNSPLIT: + case JOIN: undidmsg = _("line join"); t = make_new_node(f); t->data = mallocstrcpy(NULL, u->strdata); @@ -631,7 +631,7 @@ void do_redo(void) goto_line_posx(u->lineno, u->begin); break; #endif /* !DISABLE_WRAPPING */ - case UNSPLIT: + case JOIN: undidmsg = _("line join"); len = strlen(f->data) + strlen(u->strdata) + 1; f->data = charealloc(f->data, len); @@ -912,8 +912,8 @@ void add_undo(undo_type current_action) u->mark_begin_x += char_buf_len; break; } - /* Else purposely fall into unsplit code. */ - case UNSPLIT: + /* Else purposely fall into the line-joining code. */ + case JOIN: if (fs->current->next) { if (u->type == BACK) { u->lineno = fs->current->next->lineno; @@ -922,11 +922,11 @@ void add_undo(undo_type current_action) data = mallocstrcpy(NULL, fs->current->next->data); u->strdata = data; } - current_action = u->type = UNSPLIT; + current_action = u->type = JOIN; break; #ifndef DISABLE_WRAPPING case SPLIT_BEGIN: - current_action = fs->undotop->type; + current_action = fs->undotop->type; break; case SPLIT_END: break; @@ -1091,9 +1091,8 @@ void update_undo(undo_type action) #ifndef DISABLE_WRAPPING case SPLIT_BEGIN: case SPLIT_END: - break; #endif /* !DISABLE_WRAPPING */ - case UNSPLIT: + case JOIN: /* These cases are handled by the earlier check for a new line and action. */ case OTHER: break; -- 2.39.5