The 30 minutes timelapse for that bit of work with the redo.
The 30 minutes timelapse for that bit of work with the redo.
And now we've got basic redo as well.
I need to work on making the cursor position more intuitive after undoing, it jumps to unexpected spots rather often.
Experience using #odinlang, a language with no garbage collection (manual memory management) is that it's not that difficult. Odin makes it rather easy to keep track of and not mess up.
Anybody else interested in #odinlang odin-lang.org on ๐ฆ ? Let's be friends! I'm new here but I don't see much about one of my favorite topics.
1.5 hours of making a performant notes/todo app.
How long it took me to implement undo and then refactor to prepare for redo, and remove some arbitrary code barriers.
Basic undo implemented, every time the text is edited it takes a snapshot of the pieces, and the current snapshot is kept track of.
Next is redo, and deleting undo history when we start typing again.
1 hour timelapes of working on that memory stuff (already at 57 hours btw)
Now I attempt again the idea of implementing an undo with the piece table.
I'm thinking the piece table already has the pieces, instead of throwing them away and rebuilding them constantly, I think I'll just keep copies around of the pieces array and move backwards/forwards for the undo/redo.
macOS Activity Monitor showing textisenough app running with a memory usage of 40.7 MB.
All right I think I've handled the important memory leaks..stable ~40 MB now.
Fun journey of learning how to write memory safe Odin.
It's actually not that hard. Why are people afraid of languages with manual memory management?
Implementing soft-wrapping in a piece table friendly way is not the most straightforward thing to do, so when I figured out something decent I wrote about it.
greduan.com/blog/2024/10...