有没有办法隐藏Ace Editor中的行号?

Iva*_*her 12 javascript ace-editor

有没有办法在使用ace编辑器时删除行号?

与删除打印边距类似,如下所示?

editor.setShowPrintMargin(false);
Run Code Online (Sandbox Code Playgroud)

Lar*_*eth 22

如果要隐藏行号但保留折叠小部件的装订线:

editor.renderer.setOption('showLineNumbers', false);
Run Code Online (Sandbox Code Playgroud)

  • 现在是:`editor.setOption('showLineNumbers', false);` (2认同)

Muk*_*kus 5

更新版本 1.4.7 的答案。您可以像这样为 ace 编辑器设置多个选项,包括showGutter

this.editor.getEditor().setOptions({
    enableBasicAutocompletion: true,
    enableSnippets: true,
    enableLiveAutocompletion: true,
    showGutter: false,
    maxLines: 20
  });
Run Code Online (Sandbox Code Playgroud)