Commit 19ec1f262e67fe7094365d53ee177f900afdaad5 tried to fix some cases for history prev selection, but it broke others. Fix this properly by using a separate entry for the current edit line that is not yet in history buffer.