nadrad / h-m-m

Hackers Mind Map
GNU General Public License v3.0
1.89k stars 53 forks source link

Add undo and redo #17

Closed jinjaghost closed 2 years ago

jinjaghost commented 2 years ago

fix #3

nadrad commented 2 years ago

Thanks a lot, @jinjaghost !

When I was thinking about implementing undo, I was thinking whether save a copy of the nodes each time, as you did, or save the particular change and apply the opposite for undoing, to use less memory. The latter is much more difficult, and I don't know whether it's worth it. I'm still used to programming for computers that have 640kb memory ;)

I think we just need one other thing in your undo system: a limit for the number of undo steps. When I'm working on designing a new project, sometimes the mind map is open for weeks and I continuously work on it. Having a copy of every change would be too much. There can be a default maximum for the number of steps (e.g., 12), and it can be available in the config file as well.

Would you do it yourself or prefer it if I do?

jinjaghost commented 2 years ago

As an old real-mode DOS programmer, i understand your concerns pretty well and i'll try to find time to setup a diff only buffer.

nadrad commented 2 years ago

Great. Until then, I'll implement a simple maximum for the number of undo steps to avoid problems.