textisenough
textisenough.bsky.social
textisenough
@textisenough.bsky.social
software dev, husband. documenting journey of creating a no bs notes/todo app
The 30 minutes timelapse for that bit of work with the redo.
November 4, 2024 at 10:24 AM
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.
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.
November 4, 2024 at 10:20 AM
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.
November 4, 2024 at 8:17 AM
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.
Odin Programming Language
odin-lang.org
November 4, 2024 at 8:09 AM
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.
November 4, 2024 at 7:52 AM
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.
November 4, 2024 at 7:00 AM
1 hour timelapes of working on that memory stuff (already at 57 hours btw)
November 3, 2024 at 5:18 PM
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.
November 3, 2024 at 4:32 PM
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?
November 3, 2024 at 4:21 PM
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...
Soft-wrapping a Piece Table to draw with Raylib, in Odin - Eduardo Lavaque's Blog
greduan.com
November 3, 2024 at 10:44 AM