add multiple cursor and intelligent folding