Move cursor to end when navigating history

Fixes #244
Merge pull request #245 from lorenzhs/historycursorpos

Move cursor to end when navigating history