Set cursor position when searching