Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to hide the line numbers in Ace Editor?

Is there any way to remove the line numbers when using the ace editor?

Similar to removing the print margin as shown below?

editor.setShowPrintMargin(false);
like image 496
Ivan Bacher Avatar asked Feb 02 '15 17:02

Ivan Bacher


People also ask

How do I get an ace editor value?

To get the entered value from the ACE editor, we can use the getValue method. And to set the value of the editor, we can use the setValue method. Then we can write the following JavaScript code to get and set the editor value: const editor = ace.

What languages does ACE Editor support?

Built for Code Ace is an embeddable code editor written in JavaScript. It matches the features and performance of native editors such as Sublime, Vim and TextMate. It can be easily embedded in any web page and JavaScript application.


2 Answers

Use

editor.renderer.setShowGutter(true/false);

http://ace.c9.io/#VirtualRenderer.setShowGutter=&nav=api&api=virtual_renderer

Editor Options https://github.com/ajaxorg/ace/wiki/Configuring-Ace

like image 100
epascarello Avatar answered Oct 17 '22 13:10

epascarello


If you want to hide the line numbers but keep the gutter for the folding widgets:

editor.renderer.setOption('showLineNumbers', false);
like image 42
Lars Haugseth Avatar answered Oct 17 '22 15:10

Lars Haugseth