Commit df543e78 authored by Chris Allegretta's avatar Chris Allegretta
Browse files

- Remove a debug line I left in
- Fix undo line split uglyness.  Still not perfect but switching work envs.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4390 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
parent 12ba5573
Showing with 6 additions and 3 deletions
+6 -3
...@@ -475,9 +475,8 @@ void do_undo(void) ...@@ -475,9 +475,8 @@ void do_undo(void)
break; break;
case SPLIT: case SPLIT:
undidmsg = _("line split"); undidmsg = _("line split");
fprintf(stderr, "u->strdata = \"%s\"\n", u->strdata);
f->data = nrealloc(f->data, strlen(f->data) + strlen(u->strdata) + 1); f->data = nrealloc(f->data, strlen(f->data) + strlen(u->strdata) + 1);
strcat(f->data, u->strdata); strcpy(&f->data[strlen(f->data) - 1], u->strdata);
if (u->xflags & UNDO_SPLIT_MADENEW) { if (u->xflags & UNDO_SPLIT_MADENEW) {
filestruct *foo = openfile->current->next; filestruct *foo = openfile->current->next;
unlink_node(foo); unlink_node(foo);
...@@ -843,6 +842,7 @@ void add_undo(undo_type current_action) ...@@ -843,6 +842,7 @@ void add_undo(undo_type current_action)
fs->undotop = u; fs->undotop = u;
fs->current_undo = u; fs->current_undo = u;
u->strdata = NULL; u->strdata = NULL;
u->strdata2 = NULL;
u->cutbuffer = NULL; u->cutbuffer = NULL;
u->cutbottom = NULL; u->cutbottom = NULL;
u->mark_set = 0; u->mark_set = 0;
...@@ -882,7 +882,10 @@ void add_undo(undo_type current_action) ...@@ -882,7 +882,10 @@ void add_undo(undo_type current_action)
#endif #endif
); );
u->strdata = mallocstrcpy(NULL, &openfile->current->data[wrap_loc]); u->strdata = mallocstrcpy(NULL, &openfile->current->data[wrap_loc]);
u->strdata2 = mallocstrcpy(NULL, fs->current->next->data); /* Don't both 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);
break; break;
case INSERT: case INSERT:
case REPLACE: case REPLACE:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment