This returns the line *number*, but you are mixing it with character offsets below. I believe you want to get the offset at the beginning of the line where the partition begins. For instance, right now it closes an already closed scaladoc if there is a string **before** the scaladoc:

```Scala
""

/** ^ */
object foo extends App {
}
```

I don't think this special case is very important, so if you ask me, I'd be fine with removing the whole 'closed comment inside string' heuristic. After all, the source is in such a bad state, that nothing much can be inferred anyway.