[MOD] refine auto complete and cursor motion