save & restore cursor position after buffer modified