this function is only ever called with PASTE when cutbuffer != NULL.
* src/text.c: Rewrap, rewrite, rename, and reorder some things.
* src/text.c (do_undo, do_redo): Elide an unneeded variable.
+ * src/nano.c (unlink_node): After unlinking, also delete the node.
2015-11-21 Benno Schulenberg <bensberg@justemail.net>
* src/nano.c (main): Let the value of a --fill option on the
end->prev = newnode;
}
-/* Unlink a node from the rest of the filestruct. */
-void unlink_node(const filestruct *fileptr)
+/* Unlink a node from the rest of the filestruct and delete it. */
+void unlink_node(filestruct *fileptr)
{
assert(fileptr != NULL);
fileptr->prev->next = fileptr->next;
if (fileptr->next != NULL)
fileptr->next->prev = fileptr->prev;
+
+ delete_node(fileptr);
}
/* Delete a node from the filestruct. */
filestruct *copy_node(const filestruct *src);
void splice_node(filestruct *begin, filestruct *newnode, filestruct
*end);
-void unlink_node(const filestruct *fileptr);
+void unlink_node(filestruct *fileptr);
void delete_node(filestruct *fileptr);
filestruct *copy_filestruct(const filestruct *src);
void free_filestruct(filestruct *src);
foo = p;
bar = p->next;
unlink_node(foo);
- delete_node(foo);
renumber(bar);
}
*hage = (*hage)->next;
unlink_node(foo);
- delete_node(foo);
renumber(*hage);
}
openfile->filebot = openfile->current;
unlink_node(foo);
- delete_node(foo);
renumber(openfile->current);
openfile->totsize--;
if (foo == openfile->filebot)
openfile->filebot = f;
unlink_node(foo);
- delete_node(foo);
}
goto_line_posx(u->lineno, u->begin);
break;
if (tmp == openfile->filebot)
openfile->filebot = f;
unlink_node(tmp);
- delete_node(tmp);
}
renumber(f);
goto_line_posx(u->mark_begin_lineno, u->mark_begin_x);
#endif
unlink_node(next_line);
- delete_node(next_line);
/* If we've removed the next line, we need to go through
* this line again. */