Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[orion-dev] Syntax highlighting from CodeMirror in Orion

I've done some initial work to support CodeMirror modes for highlighting, and to see how plugin-contributed styling might work.
Here's how you can try it out:

  1. Make sure you're running the Orion client code from today (11/17) or later.
  2. Install this plugin:
    http://mamacdon.github.com/orion-codemirror/codeMirrorPlugin.html
  3. At this point you should have syntax coloring for a bunch of common file types: C/C++, HTML, JSON, Ruby, Perl, PHP, and XML.
    • You can choose to install a larger set -- visit the plugin URL in your browser for instructions. There's about 30 in total.
Tell me if you find places where the colors are missing or wrong, particularly after you make changes in the editor. I'm still trying to track down some bugs here.

Other Issues:
  • You'll see latency between typing and color updates, especially when the editor is first opened.
  • The CodeMirror highlighting doesn't supersede our (currently still hard-coded) treatment of JS, Java and CSS files.
    • However, CodeMirror will take over HTML. It gives you some new features like highlighting embedded JS inside <script> tags, and coloring mismatched tags differently.
  • Only colors are supported, not bracket matching or auto-indentation.
  • Some modes (eg. Markdown) that rely on custom CSS rules are missing colors. (Orion doesn't support custom stylesheets yet.)

Mark

Back to the top