Ensure completion menu is visible

When displaying the completion menu, it might be rendered in a
non-visible area and needs to be made visible.
Recall the saved current line after end of history

When starting a search through history, we saved the
current line.  A refactoring broke recalling this
saved line in one case (the default) so I added
some tests to make sure it doesn't regress again.