Added undo/redo for showcmd, fixed undo bugs