Fix bug 917 C-Begin C-End don't keep buffer synced