Index: src/nano.h =================================================================== --- src/nano.h (revision 4912) +++ src/nano.h (working copy) @@ -187,7 +187,7 @@ } function_type; typedef enum { - ADD, DEL, REPLACE, SPLIT, UNSPLIT, CUT, CUT_EOF, PASTE, ENTER, INSERT, OTHER + ADD, DEL, REPLACE, UNSPLIT, CUT, CUT_EOF, PASTE, ENTER, INSERT, OTHER } undo_type; typedef struct color_pair { @@ -571,7 +571,6 @@ /* Extra bits for the undo function. */ #define UNdel_del (1<<0) #define UNdel_backspace (1<<1) -#define UNsplit_madenew (1<<2) #define UNcut_cutline (1<<3) #endif /* !NANO_TINY */ Index: src/text.c =================================================================== --- src/text.c (revision 4912) +++ src/text.c (working copy) @@ -423,7 +423,6 @@ /* Undo the last thing(s) we did. */ void do_undo(void) { - bool gotolinecolumn = FALSE; undo *u = openfile->current_undo; filestruct *t = 0; size_t len = 0; @@ -468,22 +467,6 @@ f->data = data; goto_line_posx(u->mark_begin_lineno, u->mark_begin_x); break; -#ifndef DISABLE_WRAPPING - case SPLIT: - undidmsg = _("line wrap"); - f->data = (char *) nrealloc(f->data, strlen(f->data) + strlen(u->strdata) + 1); - strcpy(&f->data[strlen(f->data) - 1], u->strdata); - if (u->strdata2 != NULL) - f->next->data = mallocstrcpy(f->next->data, u->strdata2); - else { - filestruct *foo = openfile->current->next; - unlink_node(foo); - delete_node(foo); - } - renumber(f); - gotolinecolumn = TRUE; - break; -#endif /* !DISABLE_WRAPPING */ case UNSPLIT: undidmsg = _("line join"); t = make_new_node(f); @@ -546,8 +529,6 @@ } renumber(f); - if (gotolinecolumn) - do_gotolinecolumn(u->lineno, u->begin, FALSE, FALSE, FALSE, TRUE); statusbar(_("Undid action (%s)"), undidmsg); openfile->current_undo = openfile->current_undo->next; openfile->last_action = OTHER; @@ -557,7 +538,6 @@ /* Redo the last thing(s) we undid. */ void do_redo(void) { - bool gotolinecolumn = FALSE; undo *u = openfile->undotop; size_t len = 0; char *undidmsg, *data; @@ -612,16 +592,6 @@ goto_line_posx(u->lineno, u->begin); do_enter(TRUE); break; -#ifndef DISABLE_WRAPPING - case SPLIT: - undidmsg = _("line wrap"); - if (u->xflags & UNsplit_madenew) - prepend_wrap = TRUE; - do_wrap(f, TRUE); - renumber(f); - gotolinecolumn = TRUE; - break; -#endif /* !DISABLE_WRAPPING */ case UNSPLIT: undidmsg = _("line join"); len = strlen(f->data) + strlen(u->strdata) + 1; @@ -661,8 +631,6 @@ break; } - if (gotolinecolumn) - do_gotolinecolumn(u->lineno, u->begin, FALSE, FALSE, FALSE, TRUE); statusbar(_("Redid action (%s)"), undidmsg); openfile->current_undo = u; @@ -841,8 +809,6 @@ char *data; openfilestruct *fs = openfile; /* Last thing we cut to set up the undo for uncut. */ - ssize_t wrap_loc; - /* For calculating split beginning. */ if (!ISSET(UNDOABLE)) return; @@ -906,21 +872,6 @@ u->strdata = data; } break; -#ifndef DISABLE_WRAPPING - case SPLIT: - wrap_loc = break_line(openfile->current->data, fill -#ifndef DISABLE_HELP - , FALSE -#endif - ); - u->strdata = mallocstrcpy(NULL, &openfile->current->data[wrap_loc]); - /* Don't bother saving the next line if we're not prepending, - * as a new line will be created. */ - if (prepend_wrap) - u->strdata2 = mallocstrcpy(NULL, fs->current->next->data); - u->begin = wrap_loc; - break; -#endif /* !DISABLE_WRAPPING */ case INSERT: case REPLACE: data = mallocstrcpy(NULL, fs->current->data); @@ -992,7 +943,7 @@ /* Change to an add if we're not using the same undo struct * that we should be using. */ if (action != fs->last_action - || (action != ENTER && action != CUT && action != INSERT && action != SPLIT + || (action != ENTER && action != CUT && action != INSERT && openfile->current->lineno != fs->current_undo->lineno)) { add_undo(action); return; @@ -1079,13 +1030,6 @@ case ENTER: u->mark_begin_x = fs->current_x; break; -#ifndef DISABLE_WRAPPING - case SPLIT: - /* This will only be called if we made a completely new line, - * and as such we should note that so we can destroy it later. */ - u->xflags = UNsplit_madenew; - break; -#endif /* !DISABLE_WRAPPING */ case UNSPLIT: /* These cases are handled by the earlier check for a new line and action. */ case OTHER: @@ -1176,9 +1120,6 @@ return FALSE; #ifndef NANO_TINY - if (!undoing) - add_undo(SPLIT); - /* If autoindent is turned on, and we're on the character just after * the indentation, we don't wrap. */ if (ISSET(AUTOINDENT)) { @@ -1273,10 +1214,6 @@ null_at(&line->data, wrap_loc); if (prepending) { -#ifndef NANO_TINY - if (!undoing) - update_undo(SPLIT); -#endif /* If we're prepending, copy the text from the next line, minus * the indentation that we already copied above. */ strcat(new_line, next_line);