TextArea Broke? or is it me?

  Dim s As String
  Dim x As Integer
  Dim sol As Integer
  Dim eol As Integer
  Dim ln As Integer
  x=taINPUT.SelStart
  eol=x
  ln=taINPUT.LineNumAtCharPos(eol)
  sol=taINPUT.CharPosAtLineNum(ln)
  taINPUT.SelStart=sol-1
  taINPUT.SelLength=eol-sol+1
  s=taINPUT.SelText
  taINPUT.SelStart=x
  Me.title="Line # : "+Str(ln)+" Chr="+Str(sol)

I have this piece of code the is called from the taINPUT.TextChanged event, and from the Keydown if user pressed [RETURN]/[ENTER]

It is supposed to put the text of the current line into “S”

However, SOL (start of line) doesn’t change at the right time

For example… SOL=0 for the first line. type 5 characters, and press RETURN… SOL SHOULD change to 1, but I have to type 3 more characters before it changes, in which case “S” is too long for the first line (as it has part of line 2 in it), and line 2 is wrong because it is missing the first few characters

That was XojoR2… looks like R3 may be ok