Engine improvements
ughhhhhhh i spent hours making “spikes” (is that what they’re called?) and it wasn’t counted cause slint live preview/editor = not hackatime-d sighhhh
Oh well btw, hi, sorry for the random 1 month ish gap
I come back, better at Slint, and with fresh motivation.
okay so august 30 was my last commit and it is now october.
in my defense i did not touch this once in that whole time which is either very bad or very healthy idk. but something clicked today and i opened it back up and immediately went “ew who wrote this” (me. it was me.)
cough cough better engine
so the editor had this whole situation in doc.rs where Document::new would parse the markdown into an ast, and then i had this convert_blocks function that walked through the blocks AND a second function called find_block_range that literally scanned the source bytes by hand looking for double newlines to guess where each block started and ended. like manually. byte by byte. offset += whatever. i genuinely cannot believe past me looked at that and went yeah ship it
the thing is the parser already KNOWS where every block is. it has the offsets. it was just throwing them away and then i was reconstructing them with a worse, slower, buggier version downstream. so i added parse_blocks_offsets to the markdown parser so it just hands back (block, range) and now doc.rs is like. map over them, pull the range straight off, extract spans, collect. that’s it.
find_block_range is gone. convert_blocks is gone. good riddance :3
also killed the edita-core dependency because it turns out i wasn’t actually using it for anything, it was just sitting in the Cargo.toml being decorative
net result is like 1290 lines deleted vs 793 added which is my favorite kind of commit. deleting code that you wrote and were briefly proud of is so good for the soul hahaaaaa
anyway the engine is better now (cough cough not)
