Fine, I’ll build my own text editor

63 points by FedericoSchonborn


igorclark

Before you @ me about Vim bindings: shut up, I’ve got more pressing issues.

Even as a multi-decade vim veteran this made me properly laugh

chrismorgan

One severe limitation with Custom Highlights (::highlight(…)) is that you’re very limited in what you can style: simplifying slightly, it’s just color, background-color, text-decoration and text-shadow. Bold, italic? Nope. Making invisible characters faintly visible (e.g. · for Space and ⇥ for Tab) or drawing faint lines for indentation levels? Nope.

wrs

I was trying to change the code font on GitHub with a user script a while back, so I dropped into the inspector. As I imperfectly recall, it’s a textarea (presumably for selection, copy/paste, accessibility) with the same text rendered again on top of it by a div soup for formatting. So when I changed the font in the obvious place, selection no longer aligned with the text. At that point I ran away in fear.

jaredkrinke

I’ve been toying with creating an editor that supports terminal, GUI, and web.

Does an editor like that already exist? The closest I’ve seen usually involved xterm.js for the browser, but I was hoping for something native everywhere. And yes, I realize this sounds a bit crazy.

fedemp

Content editable

Another drawback with contenteditable is that it does not support native validation. Recently an employer asked me to create a form with inline fields that would grow according to its placeholder or its content. My first approach was contenteditable, even with a hidden input synced to I could send the data when submitting, but as expected, I could not set one of these fake fields as required and focus automatically when trying to submit.