Open brendand opened 6 years ago
This is not supported yet, and to be honest I don't currently have the time to implement it, but feel free to send a PR if you do so.
Not going to happen: https://highlightjs.readthedocs.io/en/latest/line-numbers.html
Highlightr just does the coloring using the highlightrjs library - it's an NSTextStorage, but the actual rendering is still done by Cocoa's NSLayoutManager and NSTextContainer.
I'm going to give this a shot using a vertical NSRuler, based on the information in the following links:
Displaying Line Numbers with NSTextView
NSRulerView how to correctly align line numbers with main text
If you've achieved this already, please stop me and help a guy out ;)
Edit: Added another link.
Adding another link that has helped me with line numbers: https://github.com/alldritt/TextKit_LineNumbers
it's an old repo but still works like a charm
Is there a function to display line numbers along the left side of the view? The syntax highlighting is great. Just needs line numbers.