moved highlight logic to editor.js