Use winsaveview() instead of getcurpos() to get curswant value