Renamed caretLineIndex to lineOffset