Open lzanoni-stm opened 8 months ago
See the "Syntax Highlighting" scenario in the UICatalog
project and you will have all answers for these questions. You can use the CurrentColumn
and the CurrentRow
to get it's positions.
Here is the method.
See we call get line and then assign a color scheme.
We use regex to do multi line 'are we in comment block' etc
I've a TextView and I'd like to color(hightlight) some word knowing the start position from the beginning of the text, and the length. I overrode protected override void SetNormalColor(List line, int idx)
but of course, I receive it for each line, and thus, it's coloring a rectangle spanning all the lines.
Any idea how to know on to convert from absolute text position to line and column? I also don't see how I will know on which line I'm, from inside the override.
Or maybe I should not use TextView in this case ?