Use a slightly more complicated heuristic for adjusting cursor pos at start of change

Issue #1415