Skip to content

Commit

Permalink
Fix excessive autoclose calls
Browse files Browse the repository at this point in the history
Signed-off-by: Fred Bricon <fbricon@gmail.com>
  • Loading branch information
fbricon authored and NikolasKomonen committed Jun 6, 2019
1 parent 840fb4e commit e3b0081
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/tagClosing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ export function activateTagClosing(tagProvider: (document: TextDocument, positio
return;
}
let activeDocument = window.activeTextEditor && window.activeTextEditor.document;
let a = document !== activeDocument;
let b = changes.length === 0;
if (document !== activeDocument || changes.length === 0) {
return;
}
Expand All @@ -55,7 +53,7 @@ export function activateTagClosing(tagProvider: (document: TextDocument, positio
}
let lastChange = changes[changes.length - 1];
let lastCharacter = lastChange.text[lastChange.text.length - 1];
if (lastChange.rangeLength > 0 || lastChange.text.length > 1 || lastCharacter in TRIGGER_CHARACTERS) {
if (lastChange.rangeLength > 0 || lastChange.text.length > 1 || TRIGGER_CHARACTERS.indexOf(lastCharacter) < 0) {
return;
}
let rangeStart = lastChange.range.start;
Expand Down

0 comments on commit e3b0081

Please sign in to comment.