Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I find currently loaded mode (syntax) in Ace Editor?

Tags:

ace-editor

Well as the title says - how do I find out what the currently loaded mode is in Ace Editor?

editor.getSession().getMode() does not really return anything I can use - have looked through the objects returned somewhat - but could not find anything.

editor.getTheme() returns a string to me that I can use however - just seems funny if they did not do somewhat the same for mode

like image 878
Splynx Avatar asked May 09 '12 13:05

Splynx


People also ask

What languages does ACE Editor support?

Editing documents with millions of lines as fast as small docs. Syntax highlighting in 45 languages including JavaScript, Java, C#, C, C++, Clojure, Go, Groovy, JSON, Scala, Ruby, XML, and others. Emacs, Vi key bindings. Support for TextMate themes.

Is Ace editor open source?

Get the Open-Source Code The Ace source code is hosted on GitHub and released under the BSD license ‐ very simple and friendly to all kinds of projects, whether open-source or not. Take charge of your editor and add your favorite language highlighting and keybindings!

How do I resize an ace editor?

Here's my solution to resizing the Ace Editor window without jitter, using jQuery UI, or any other additional libs (as that is just additional bloat). Dragging is handled by a 2px tall div, which on mousedown sets opacity to 0 on the editor, and then back to 1 on mouseup.


1 Answers

To retrieve the name of the mode you use:

editor.getSession().getMode().$id
like image 200
Hugeen Avatar answered Sep 22 '22 19:09

Hugeen