【问题标题】:Is there a way to hide the line numbers in Ace Editor?有没有办法在 Ace Editor 中隐藏行号?
【发布时间】:2015-04-01 17:31:02
【问题描述】:

使用ace编辑器时有什么方法可以去掉行号吗?

类似于去掉打印边距,如下图?

editor.setShowPrintMargin(false);

【问题讨论】:

  • @epascarello 非常感谢。要添加为答案以便我接受吗?

标签: javascript ace-editor


【解决方案1】:
【解决方案2】:

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

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

【讨论】:

  • 现在是:editor.setOption('showLineNumbers', false);
【解决方案3】:

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

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

【讨论】:

  • 很好的答案。谢谢
猜你喜欢
  • 2013-02-01
  • 2022-12-03
  • 1970-01-01
  • 2016-05-29
  • 2021-09-02
  • 1970-01-01
  • 1970-01-01
  • 2016-01-18
  • 1970-01-01
相关资源
最近更新 更多