Making sure line renumbering starts far enough back after
undoing a cut or paste. And fixing two memory leaks. Patch by Mark Majeres. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5067 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
ee7bbf4650
commit
2394e52ebc
|
@ -1,5 +1,11 @@
|
||||||
|
2014-07-16 Mark Majeres <mark@engine12.com>
|
||||||
|
* src/text.c (do_undo): Make sure renumbering starts far enough back
|
||||||
|
after undoing a cut or paste. This fixes a segmentation fault when
|
||||||
|
undoing a repeated cutting and pasting of the first line of a file.
|
||||||
|
* src/nano.c (move_to_filestruct, copy_from_filestruct): Fix two leaks.
|
||||||
|
|
||||||
2014-07-13 David Lawrence Ramsey <pooka109@gmail.com>
|
2014-07-13 David Lawrence Ramsey <pooka109@gmail.com>
|
||||||
* ChangeLog: Typo fix
|
* ChangeLog: Typo fix.
|
||||||
|
|
||||||
2014-07-12 Benno Schulenberg <bensberg@justemail.net>
|
2014-07-12 Benno Schulenberg <bensberg@justemail.net>
|
||||||
* configure.ac: The warning about datarootdir being ignored is
|
* configure.ac: The warning about datarootdir being ignored is
|
||||||
|
|
|
@ -360,6 +360,9 @@ void move_to_filestruct(filestruct **file_top, filestruct **file_bot,
|
||||||
*file_bot = openfile->filebot;
|
*file_bot = openfile->filebot;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
openfile->fileage->next = NULL;
|
||||||
|
free_filestruct(openfile->fileage);
|
||||||
|
|
||||||
/* Renumber starting with the line after the original
|
/* Renumber starting with the line after the original
|
||||||
* file_bot. */
|
* file_bot. */
|
||||||
if (file_bot_save->next != NULL)
|
if (file_bot_save->next != NULL)
|
||||||
|
@ -447,6 +450,7 @@ void copy_from_filestruct(filestruct *somebuffer)
|
||||||
|
|
||||||
/* Put the top and bottom of the current filestruct at the top and
|
/* Put the top and bottom of the current filestruct at the top and
|
||||||
* bottom of a copy of the passed buffer. */
|
* bottom of a copy of the passed buffer. */
|
||||||
|
free_filestruct(openfile->fileage);
|
||||||
openfile->fileage = copy_filestruct(somebuffer);
|
openfile->fileage = copy_filestruct(somebuffer);
|
||||||
openfile->filebot = openfile->fileage;
|
openfile->filebot = openfile->fileage;
|
||||||
while (openfile->filebot->next != NULL)
|
while (openfile->filebot->next != NULL)
|
||||||
|
|
|
@ -504,10 +504,12 @@ void do_undo(void)
|
||||||
case CUT:
|
case CUT:
|
||||||
undidmsg = _("text cut");
|
undidmsg = _("text cut");
|
||||||
undo_cut(u);
|
undo_cut(u);
|
||||||
|
f = fsfromline(u->lineno);
|
||||||
break;
|
break;
|
||||||
case PASTE:
|
case PASTE:
|
||||||
undidmsg = _("text uncut");
|
undidmsg = _("text uncut");
|
||||||
undo_paste(u);
|
undo_paste(u);
|
||||||
|
f = fsfromline(u->lineno);
|
||||||
break;
|
break;
|
||||||
case ENTER:
|
case ENTER:
|
||||||
undidmsg = _("line break");
|
undidmsg = _("line break");
|
||||||
|
|
Loading…
Reference in New Issue