// text-editor optimization