Fix bug for start or end of the file search

When there's no space for search, only stay there
Merge branch 'hotfix/char-not-found-bug'