6

我想使用 Ace Editor 将代码片段嵌入到页面中,如此处所示

然而,由于这些片段是从一个更大的文件中提取的,我希望装订线中的行号能够反映代码的原始行号。换句话说,我希望能够为嵌入式实例指定它应该分配给第一行并从其计数的数字。

可以将 Ace Editor 配置(或破解)以这种方式运行吗?

4

1 回答 1

8

轻松,打电话

editor.setOption("firstLineNumber", 10)
// this is same as editor.session.setOption(...)

https://github.com/ajaxorg/ace/blob/16b542aea/lib/ace/editor.js#L2681

于 2013-07-28T06:18:45.450 回答