fix the cursor offset when exit insert mode