Fix an exception when pressing up-arrow in a buffer without history
Merge pull request #389 from glowing-bear/fix-history-exception

Fix an exception when pressing up-arrow in a buffer without history