Is there a way to hide the line numbers in Ace Edi

2019-02-16 13:39发布

问题:

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);

回答1:

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



回答2:

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

editor.renderer.setOption('showLineNumbers', false);