Cursor offset should never be past end of text length [#76411614]