The change introduced in 92f350e617 led to
a regression in the MoveEndpointByUnit function. In this case, a
backward movement by a single character *should* move the endpoint as
long as it remains within the text range.
The issue addressed by the faulty commit is better fixed by
special-casing the 'character' unit case in the ExpandToEnclosingUnit
function.
Narrator on Windows seems to call ExpandToEnclosingUnit to find the
character immediately following the current cursor position. When
expanding a degenerate range with position `input` (used to represent
the cursor position) to a single-character range, the returned range
should start at `input` and end at `input+1`. Previously,
findTextBoundary() would always return the position before
currentPosition when searching backwards by character, so the result of
ExpandToEnclosingUnit would be off-by-one when expanding to the closest
character.