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
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.
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!
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.
To retrieve the name of the mode you use:
editor.getSession().getMode().$id
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With