Added Ace

18th Feb 2013

Note (2014.01.05): Since I'm no longer using drupal this isn't relevant to my site anymore.

Bespin, as it was called, or now Ace is something I always thought was awesome. Code Editing, in the browser? Sweet!

So apparently there's 2 big projects now for this Ace and Code Mirror. I've actually used the second one quite a lot at work. We develop with the Contao CMS and internally it uses code mirror, so everytime you edit html within the browser that's what loads. I think the downside of Ace is that it doesn't play as nice with falling back to a textarea. On the other hand it has some pretty impressive editing features. I've seen it mark lines with an X in the margin when they're not valid in json and javascript, just on the fly.

Since I write most of my posts in good old html I figured i should try to load it on here. I found a drupal ace plugin and decied to try it out. The ace editor is nice but the plugin hasnt' been updated in more than a year. So first problem it didn't have softwrap, so long lines are really long. I tried turning it on by just adding the 2 lines of code it should take. But it apparently does some live settings updates and it gets overriden and things start breaking. For now i just turned off automatic line breaks and use good old paragraph tags. We'll see how it goes (may be I'll hack around it some more or try to do something else).

Maybe there's a code mirror plugin that's more up-to-date i can try!