bug fixed: resetAttributes doesn't work correctly when inserting text with length > 1