There is a property
CurrentLines: TSynEditStringsBase
It is the textbuffer. So you can access lines from the text.
There is no guaranteed way to the SynEdit (and it may be more than one SynEdit)
Currently CurrentLines are of the class TSynEditStringList
Which is the actual textbuffer, and has a
function AttachedSynEditCount: Integer;
property AttachedSynEdits[Index: Integer]: TSynEditBase read GetAttachedSynEdits;
As I said, with 2 or more SynEdits editing the same text, there is more than one SynEdit. But each SynEdit may have a different Highlighter (or have the same), so you would need to search all of them, until you find the one that uses this HL.
Further more: If (for example) you are using a TSynMultySyn, and one of the sub-HL is of your type, then CurrentLines, if of a different class, and no link to the SynEdit exists.
And the above is not guaranteed. In future CurrentLine can point to other classes, even in normal cases.
------------------------
I guess you want to get your markup? and pass on the error locations?
The correct way, is for the HL to store them, and the Markup (which knows the edit and the HL) to query them.
TIP: if you need per SynEdit space to store: inherit a new class for the Range. The range is stored on the textbuffer, so if you use the HL from multiple edits, there are different instances of the range.
CurrentLines can be used, if you need to peek at the next or previous line fo text. that it will always do, even in future.