diff --git a/src/vs/workbench/parts/emmet/node/actions/updateTag.ts b/src/vs/workbench/parts/emmet/node/actions/updateTag.ts index 2bd39a4753ff8997f155d851b19eed0bef028b93..a5cb171dae54be25ce3a54d314ae38a7906f0c6d 100644 --- a/src/vs/workbench/parts/emmet/node/actions/updateTag.ts +++ b/src/vs/workbench/parts/emmet/node/actions/updateTag.ts @@ -34,7 +34,7 @@ class UpdateTagAction extends EmmetEditorAction { } private wrapAbbreviation(_emmet: any, tag) { - if (!_emmet.run('update_tag', this.editorAccessor, tag)) { + if (tag && !_emmet.run('update_tag', this.editorAccessor, tag)) { this.editorAccessor.noExpansionOccurred(); } } diff --git a/src/vs/workbench/parts/emmet/node/actions/wrapWithAbbreviation.ts b/src/vs/workbench/parts/emmet/node/actions/wrapWithAbbreviation.ts index aec7c8d5d97236e52c1d926cd84d71636fdf09a7..5477bda658c0b701387710316e9dfb4521919735 100644 --- a/src/vs/workbench/parts/emmet/node/actions/wrapWithAbbreviation.ts +++ b/src/vs/workbench/parts/emmet/node/actions/wrapWithAbbreviation.ts @@ -34,7 +34,7 @@ class WrapWithAbbreviationAction extends EmmetEditorAction { } private wrapAbbreviation(_emmet: any, abbreviation) { - if (!_emmet.run('wrap_with_abbreviation', this.editorAccessor, abbreviation)) { + if (abbreviation && !_emmet.run('wrap_with_abbreviation', this.editorAccessor, abbreviation)) { this.editorAccessor.noExpansionOccurred(); } } diff --git a/src/vs/workbench/parts/emmet/node/editorAccessor.ts b/src/vs/workbench/parts/emmet/node/editorAccessor.ts index ad77d9d543e14372e15f6cdba766121995f8fe03..271418bfce3efff488c46355cd3b8641bdf2badd 100644 --- a/src/vs/workbench/parts/emmet/node/editorAccessor.ts +++ b/src/vs/workbench/parts/emmet/node/editorAccessor.ts @@ -23,9 +23,11 @@ export class EditorAccessor implements emmet.Editor { this.editor = editor; } - public noExpansionOccurred(): void { - // return the tab key handling back to the editor - this.editor.trigger('emmet', Handler.Tab, {}); + public noExpansionOccurred(actionId?: string): void { + // return the tab key handling back to the editor only for Expand Abbreviation command + if (actionId === 'editor.emmet.action.expandAbbreviation') { + this.editor.trigger('emmet', Handler.Tab, {}); + } } public isEmmetEnabledMode(): boolean { diff --git a/src/vs/workbench/parts/emmet/node/emmetActions.ts b/src/vs/workbench/parts/emmet/node/emmetActions.ts index 469b89771ddcc2ccb648379c0fe247de08924d04..e4383c62dff4723428e6ac0e73215428941dec5c 100644 --- a/src/vs/workbench/parts/emmet/node/emmetActions.ts +++ b/src/vs/workbench/parts/emmet/node/emmetActions.ts @@ -68,7 +68,7 @@ export abstract class EmmetEditorAction extends EditorAction { try { if (!this.editorAccessor.isEmmetEnabledMode()) { - this.editorAccessor.noExpansionOccurred(); + this.editorAccessor.noExpansionOccurred(this.id); return; } this.updateEmmetPreferences(_emmet);