undo-redo & linear ports
fix #1015