Edit line numbers in Eclipse

For one of the by-products, I want to manipulate the line numbers that appear in the editor in eclipse. Basically for multiple lines, I want to show it in the following order:

1 2 3 3_1 3_2 3_3 4 and so.. 

Which class handles line numbers. I tried to look at the source and found MarkerField , but this is not very useful. Is it possible?

+6
source share
2 answers

org.eclipse.jface.text.source.LineNumberRulerColumn is responsible for displaying line numbers. org.eclipse.jface.text.source.LineNumberChangeRulerColumn above for other minor tweaks.

This is both initialized and used by org.eclipse.ui.texteditor.AbstractDecoratedTextEditor . TextEditor continues above, and eclipse is used by default. Therefore, to manipulate, in each class there is something to do, respectively.

I hope someone can provide a more complete answer

+3
source

Regulator strings are provided using the org.eclipse.ui.workbench.texteditor.rulerColumns extension point.

An existing line number column is provided using this mechanism and uses the org.eclipse.ui.internal.texteditor.LineNumberColumn class to display the LineNumberChangeRulerColumn mentioned in @Jatin's answer.

It will be difficult to change an existing column of linear line numbers, it is much easier to add a new column.

+1
source

All Articles