Re-add resCur function for remember the cursor position in last time