3 ms·
CodeMirror and Ace both have a long history of sane competition, and copied many of the ideas from one another. So much, in fact, that whenever I find myself in
by espadrine 14y ago
CodeMirror and Ace both have a long history of sane competition, and copied many of the ideas from one another. So much, in fact, that whenever I find myself in front of an Ace editor, I open up the DevTools and change the CSS to make the cursor 1 pixel wide. They have pretty much the same cursor display system!
A great difference, in my opinion, is the syntax highlighting systems. Ace's is more rule-based (as in, regex matches and regions), while CodeMirror's is more programmatic, which helps its JS mode show local variables in a different color.
There are also differences in the data structures used internally, afaik. Marijn can probably talk more about that.
On a different note, CodeMirror is being seriously considered independently in WebKit's and Firefox' DevTools, built-in. You may soon use it every day without even knowing!
- kibwen 14y ago> CodeMirror is being seriously considered independently in WebKit's and Firefox' DevTools, built-in. Whoa, can you cite sources for these?
- espadrine 14y agoWebKit: https://bugs.webkit.org/show_bug.cgi?id=92769 https://bugs.webkit.org/show_bug.cgi?id=92769 https://bugs.webkit.org/show_bug.cgi?id=94062 https://bugs.webkit.org/show_bug.cgi?id=94062 Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=816756 https://bugzilla.mozilla.org/show_bug.cgi?id=816756
- kibwen 14y agoWow, so it's already landed in Webkit, presumably behind some experimental flag. This is really neat, thanks.
- gjtorikian 14y agoDeveloper for Ace here. The syntax highlighting rules for Ace were largely derived from tmlanguage files. This allows us to pretty easily import existing definitions. For example, Google had a tmlanguahe file for Dart that I was able to translate in less than an hour. Could you describe more about what you like about CM's highlight rules? I admit I've never really looked into them. But I'm guessing by "show local variables in a different color" there's some parsing going on?