Fix seek undo and make s.. push in the undo history

This commit is contained in:
pancake 2018-04-02 22:41:12 +02:00
parent 8675e324ac
commit 5a5ab2693b
2 changed files with 5 additions and 0 deletions

View File

@ -402,6 +402,7 @@ static int cmd_seek(void *data, const char *input) {
;
}
r_core_seek_base (core, input);
r_io_sundo_push (core->io, core->offset, r_print_get_cursor (core->print));
break;
case 'j': // "sj"
{

View File

@ -44,6 +44,10 @@ R_API RIOUndos *r_io_sundo(RIO *io, ut64 offset) {
undo->cursor = 0;
}
// hack to fix undo seek
if (io->undo.redos == 0) {
io->undo.idx--;
}
io->undo.idx = (io->undo.idx - 1 + R_IO_UNDOS) % R_IO_UNDOS;
io->undo.undos--;
io->undo.redos++;