I'd like to embed code snippets into a page with Ace Editor as demonstrated here.
However since these snippets are to be drawn from a larger file, I'd like the line numbers in the gutter to reflect the original line number of the code. In other words I'd like to be able to specify for an embedded instance, what number it should assign to the first line and count from.
Can Ace Editor be configured (or hacked) to behave in this way?
easily, call
editor.setOption("firstLineNumber", 10)
// this is same as editor.session.setOption(...)
see https://github.com/ajaxorg/ace/blob/16b542aea/lib/ace/editor.js#L2681
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