With SetLineHidden, could you please explain it in more detail? Do you have hidden lines at the beginning of the text, and the first visible line shows a different value to 1?
TextEditor has the property LineNumbersStart, which you can configure to start numbers from a different value. However, it does not accept zero or negative numbers (which can be easily fixed).
Thank you for your response. Your answer in number 1 works and exactly what I needed. Thanks for that.
For my second inquiry. I think the LineNumbersSart doesn’t work if some of my lines are hidden. Kindly see screenshot
There are before and after lines hidden and only this Hello method is visible. As I can see, it shows the original line number, hence it started with line 8. The lines 1-7 are some of the lines I hid.
We will release a small update via NuGet shortly, which will allow setting LineNumbersSart to the negative number - this way it should work in case you have a few hidden line numbers at the beginning of the text.
We will also add a property that will take into account hidden lines when displaying line numbers even if these hidden lines are somewhere in the middle of the text - this one will be included in the next regular update.
We’ve just released a small update to NuGet (version 9.1.3) where the issue with setting LineNumbersSart to the negative values should be fixed; it should allow adjusting line numbers to be displayed from 1 in case there are hidden lines at the beginning of the text.