Add test for retain cursor position