RSyntaxTextArea
RSyntaxTextArea copied to clipboard
Add ability to skip line numbers in LineNumberList, or make Gutter.lineNumberList mutable
Feature request is extremely niche, but required for an application I develop. Users are presented with a code editor that acts like a function - there's a fixed function definition and documentation comment, then the user's content. I don't use the documentation comment when actually saving or compiling their script - both for optimization, and so that I can freely change the documentation as needed. I would like to be able to customize the rendering in LineNumberList so that I can 'skip' the visible line numbers by a certain amount.
I can't really imagine what other circumstances someone else might need this functionality, so before I file a PR I wanted to ask:
- Would you be interested in adding this feature? What I'm currently working with would add two fields to
LineNumberList-omittedLineNumbers, which would just aSet<Integer>orint[]that specifies which line indexes to skip, andcountOmittedLines- whether the line index should increment for these skipped lines or not. My application only actually needsomittedLineNumbersandcountOmittedLines = false, but I figure I'd make the API more flexible - if you want to add this. - If you (totally justifiably) don't want to add this first party, can I file a PR to add a getter/setter to
Gutter.lineNumberList. It looks like if I had that, I could handle the line numbering myself with a subclass ofLineNumberList; you don't have to worry about maintaining this, and I don't have to worry about implementing my own gutter.
Figure for reference - if there's an error in the user's first line of scripting, it's reported as line 2, but line 10 by the UI, which leads to confusion:
