Get text up to cursor position.