I hope I don’t come over too negative, but why begin by trying to replicate that we already have, in spades? Whilst it’s good to try and “make a thing”, if you begin from what we already have, you will innevitably be held hostage by all that is bad about text editors. You will end making a sub-standard version of what we already have working.
And the Brasin OS is a lovely nonsense. We don’t need a pretend operating system, and even MacOS itself is failing to build on its great work in 1987. Very little has moved on. It’s stale.
I would argue that Processing/p5js is a tool for you to bring NEW IDEAS into life.
Might I suggest that you checkout the Lifestreams concept https://www.wired.com/1997/02/lifestreams/ or Jef Raskin has ideas for an OS called LEAP, a text editor but not, a programming language, way of navigating… and check this… I just downloaded it… wild!
https://apps.apple.com/app/raskin/id404175816?mt=12&ls=1 …/ but LEAP was perhaps more like this… https://github.com/hundredrabbits/Left
History is littered with fabulous ideas that didn’t, and couldn’t, quite work, but we are living in different times now. Maybe your next “text editor” will blow the doors off writing somehow in ways Notepad won’t 
Good luck.