Fix a breakage in move detection when moving from the end of a file.

The move detection logic tries a look-ahead for a blank line on the
source range, which assumed there would be a line following that range.
That's not true when moving the very last lines in a file, though.

This change only does the look-ahead if there is a line to look ahead
at.