Fix auto-scroll window issue

Undo() function will scroll window. Then after call it, we should:
1. SetSel(0) to scroll the window the '0' pos
2. SetSel(After,TRUE) re-select the last selection without scrolling
window.