Undo after save. How?

General TRichView support forum. Please post your questions here
Post Reply
Martian
Posts: 95
Joined: Sun Apr 03, 2011 7:32 pm

Undo after save. How?

Post 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?
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

TRichViewEdit does not lose undo after save.
Martian
Posts: 95
Joined: Sun Apr 03, 2011 7:32 pm

Post by Martian »

Hm. But for some reason my undo button became inactive after save. Gonna check my code then.
Martian
Posts: 95
Joined: Sun Apr 03, 2011 7:32 pm

Post 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?
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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.
Post Reply