Handle restore cursor position when visual mode

hi yuex.

Your work which fix visual selection bug is nice! But there is one problem.

Problem: Restoring cursor position doesn't work correctly when target key is no match.

This commit fix this problem