diff --git a/ChangeLog b/ChangeLog index 84aa125d54a5f9679ac781006bd2577c81c04a7e..bd83f5c0f0c882e5ad90ac89cf5e4fe6e2e5f6be 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 <mark@engine12.com> * 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 fb2ddf444d798a10efa13828b210fd6cd7f03d36..d4d81ed44aab161d1e88a6dcbfe75d9c488df516 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 4dbaf71fab5bf66e133ea9136b42aa22f5b28193..34d66a6e1b90816732bfc96bcf38d386a3deedc7 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;