Skip to content

Commit

Permalink
Fix don't append ">" when typed "/" before ">". (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnytemp authored and formulahendry committed Aug 9, 2018
1 parent 982beeb commit a42055d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,11 @@ function insertAutoCloseTag(event: vscode.TextDocumentChangeEvent): void {
});
}
} else {
editor.edit((editBuilder) => {
editBuilder.insert(originalPosition, ">");
})
if (textLine.text.length <= selection.start.character + 1 || textLine.text[selection.start.character + 1] !== '>') { // if not typing "/" just before ">", add the ">" after "/"
editor.edit((editBuilder) => {
editBuilder.insert(originalPosition, ">");
})
}
}
}
}
Expand Down

0 comments on commit a42055d

Please sign in to comment.