Rename `doc` variable to `codeMirror`

To more accurately reflect what it is
Remove unnecessary `!editor` check
Batch `indentLine` operations