“They don’t make ’em like Sublime Text anymore” resonated with a lot of folk. Software these days is garbage. That got me thinking; I’m good at building garbage!
Why can’t I build my own text editor?
VS Code is built upon Monaco Editor which is a <div> soup hellscape. I was late to the VS Code train because for years my Intel inside™ Mac was too slow. That issue was resolved when I bought Apple silicon. If that’s the standard I have a lot of room to make mistakes.
Canvas
My first experiment renders everything on a <canvas> element.
You can’t tell, but your CPU is doing a lot of work to render that picture at 60–120 frames per second. Lack of interactivity is an obvious problem for a text editor.
I made a list of the “minimum viable” features and implemented them.
Pointer down to position text cursor
Arrow keys to move text cursor
Highlight current line
... continue reading