Fix typos

This commit is contained in:
Mohammad Rahhal
2019-12-14 13:45:22 +02:00
parent 3dea65ba1b
commit 2d3c754f71

View File

@@ -66,13 +66,13 @@ export function activateMirrorCursor(
if (event.selections[0].isEmpty) {
matchingTagPositionProvider(event.textEditor.document, event.selections[0].active).then(matchingTagPosition => {
if (matchingTagPosition && window.activeTextEditor) {
const charBeforeAndAfterPositionsRoughtlyEqual = isCharBeforeAndAfterPositionsRoughtlyEqual(
const charBeforeAndAfterPositionsRoughlyEqual = isCharBeforeAndAfterPositionsRoughlyEqual(
event.textEditor.document,
event.selections[0].anchor,
new Position(matchingTagPosition.line, matchingTagPosition.character)
);
if (charBeforeAndAfterPositionsRoughtlyEqual) {
if (charBeforeAndAfterPositionsRoughlyEqual) {
inMirrorMode = true;
const newCursor = new Selection(
matchingTagPosition.line,
@@ -103,13 +103,13 @@ export function activateMirrorCursor(
return;
}
const charBeforeAndAfterPositionsRoughtlyEqual = isCharBeforeAndAfterPositionsRoughtlyEqual(
const charBeforeAndAfterPositionsRoughlyEqual = isCharBeforeAndAfterPositionsRoughlyEqual(
event.textEditor.document,
event.selections[0].anchor,
event.selections[1].anchor
);
if (!charBeforeAndAfterPositionsRoughtlyEqual) {
if (!charBeforeAndAfterPositionsRoughlyEqual) {
exitMirrorMode();
return;
} else {
@@ -154,8 +154,8 @@ function getCharAfter(document: TextDocument, position: Position) {
}
// Check if chars before and after the two positions are equal
// For the chars before, `<` and `/` are consiered equal to handle the case of `<|></|>`
function isCharBeforeAndAfterPositionsRoughtlyEqual(document: TextDocument, firstPos: Position, secondPos: Position) {
// For the chars before, `<` and `/` are considered equal to handle the case of `<|></|>`
function isCharBeforeAndAfterPositionsRoughlyEqual(document: TextDocument, firstPos: Position, secondPos: Position) {
const charBeforePrimarySelection = getCharBefore(document, firstPos);
const charAfterPrimarySelection = getCharAfter(document, firstPos);
const charBeforeSecondarySelection = getCharBefore(document, secondPos);