Fix bug #9495 with cursor positioning on truncated lines.