implement move_caret_to_next