Skip to content

Commit

Permalink
Part of #71996
Browse files Browse the repository at this point in the history
  • Loading branch information
octref committed Sep 3, 2019
1 parent 6829b31 commit 1c623c1
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions extensions/emmet/src/abbreviationActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,21 @@ export function expandEmmetAbbreviation(args: any): Thenable<boolean | undefined
return fallbackTab();
}

if (vscode.window.activeTextEditor.selections.length === 1 &&
vscode.window.activeTextEditor.selection.isEmpty
) {
const anchor = vscode.window.activeTextEditor.selection.anchor;
if (anchor.character === 0) {
return fallbackTab();
}

const prevPositionAnchor = anchor.translate(0, -1);
const prevText = vscode.window.activeTextEditor.document.getText(new vscode.Range(prevPositionAnchor, anchor));
if (prevText === ' ' || prevText === '\t') {
return fallbackTab();
}
}

args = args || {};
if (!args['language']) {
args['language'] = vscode.window.activeTextEditor.document.languageId;
Expand Down

0 comments on commit 1c623c1

Please sign in to comment.