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);
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.
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.
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
If you want to hide the line numbers but keep the gutter for the folding widgets:
editor.renderer.setOption('showLineNumbers', false);
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