Restore state of buffer in errors

When a error occurs it is important to remove all the modifications
done by the offending command and restore the value of dot to the
state before of executing the command.
This commit is contained in:
Roberto E. Vargas Caballero 2015-12-14 15:38:46 +01:00 committed by sin
parent 13e0b6c605
commit 0cd385d164
1 changed files with 6 additions and 0 deletions

6
ed.c
View File

@ -62,6 +62,9 @@ static char *lastmatch;
static struct undo udata;
static int newcmd;
static void undo(void);
static void
error(char *msg)
{
@ -80,6 +83,9 @@ error(char *msg)
/* nothing */;
}
if (!newcmd)
undo();
curln = ocurln;
longjmp(savesp, 1);
}