Increase Undo History Length

When I try to undo a lot of strokes the undo-history seems to have gone.

I would like to increase the persistency of the history and/or the amount of input saved in the history. How do I do that?

Basic System Details

MyPaint version: 64bit 2.0.0+git.af5225a2

Operating System + Version: Windoes 10

I’d also appreciate an option for this. I think, currently it’s still hard-coded to 30 and that is really not much.

There is an open issue about this to be handled dynamically here:

I personally dont see the memory problem as a valid argument for 99% of users but maybe there is a better solution that someone has in mind. I’m also not sure whether the undo stack is even one of the most memory intense components in mypaint.

I also made some (testing) modifications back in 2018 that set the limit higher and uses a deque instead of rewriting a stack manually whenever it was full. That resulted in a noticable performance boost when using high undo limits.

See the changes HERE

Yeah, memory might have been more of an issue in 2009/2011, but I see no reason to leave this as a constant. At the very least it should be possible to set in the user config.

@toniw
If you don’t mind, I’ll cherry pick your first commit and then factor out the size to a parameter (and maybe increase the default to 50).

1 Like

Moved to Feature Requests and Adjusted title accordingly.

Configurable undo stack size is now in the master branch, and since it involves no gui string changes it will be backported to the upcoming 2.0.1 (mostly) bugfix release. For now the size is only configurable by editing the settings.json file, but proper inputs will most likely be added for the next minor release.

1 Like