Page 1 of 1

Undo after save. How?

Posted: Thu Apr 28, 2016 8:40 pm
by Martian
In my app I always save document when user switches to another app or minimize.
It's very uncomfortable to lose undo after save.
So how to do it in TRichViewEdit?

Posted: Thu Apr 28, 2016 9:15 pm
by Sergey Tkachenko
TRichViewEdit does not lose undo after save.

Posted: Thu Apr 28, 2016 11:35 pm
by Martian
Hm. But for some reason my undo button became inactive after save. Gonna check my code then.

Posted: Sun May 01, 2016 8:40 am
by Martian
I found the reason why I lose undo every time I save my document.
It's because of

Code: Select all

RichViewEdit1.DeleteUnusedStyles(True,True,True);
I wrote this code several years ago and maybe it's not really necessary in the latest versions of RVE?

Posted: Mon May 02, 2016 7:59 am
by Sergey Tkachenko
This code still may reduce the file size.
But it still clears undo buffer.
So I recommend to call it on loading instead of on saving.