Return if there was parsing error

This commit is contained in:
Ramya Achutha Rao
2017-06-26 14:18:15 -07:00
parent fc6c69311d
commit 915e1eb8cb
7 changed files with 23 additions and 4 deletions

View File

@@ -41,7 +41,9 @@ export function toggleComment() {
}
let rootNode = parseContent(new DocumentStreamReader(editor.document));
if (!rootNode) {
return;
}
editor.edit(editBuilder => {
editor.selections.reverse().forEach(selection => {
let [rangesToUnComment, rangeToComment] = toggleCommentInternal(editor.document, selection, rootNode);