fish vi-mode: Ensure directions always return valid results
fish vi-mode: Ensure directions always return valid results

Directions try to ensure both the cursor and command target are in the
right place, but there are a few edge cases I keep having to check for.

One such edge case is when the commandline is empty, which caused the w
and e commands to return an invalid position and error out.

This adds an overall validation to make sure that the position returned
from any direction is within the commandline.

It may also be worth adding a routine that specific directions can use
to ensure that the cursor hasn't moved to a different line.

Signed-off-by: Ian Munsie <ce389fd2fa887d610219cb85dea6dc9451973e74@gmail.com>

DarkStarSword/junk,DarkStarSword/junk,DarkStarSword/junk,DarkStarSword/junk,DarkStarSword/junk