Skip to content

Commit

Permalink
Fixes #8: Conflict with Emmet
Browse files Browse the repository at this point in the history
  • Loading branch information
formulahendry committed Jul 26, 2016
1 parent 3400ed0 commit 77a910a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ By default, it is `["*"]` and will be activated for all languages.
**Note:** The setting should be set with language id defined in [VS Code](https://github.com/Microsoft/vscode/tree/master/extensions). Taking [javascript definition](https://github.com/Microsoft/vscode/blob/master/extensions/javascript/package.json) as an example, we need to use `javascript` for `.js` and `.es6`, use `javascriptreact` for `.jsx`. So, if you want to enable this extension on `.js` file, you need to add `javascript` in settings.json.

## Change Log
### 0.0.7
* Fix [GitHub issue#8](https://github.com/formulahendry/vscode-auto-rename-tag/issues/8)

### 0.0.6
* Merge [PR#7](https://github.com/formulahendry/vscode-auto-rename-tag/pull/7): Remove console.log
* Update README.md to clarify the configuration for `auto-rename-tag.activationOnLanguage`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "auto-rename-tag",
"displayName": "Auto Rename Tag",
"description": "Auto rename paired HTML/XML tag",
"version": "0.0.6",
"version": "0.0.7",
"publisher": "formulahendry",
"icon": "images/logo.png",
"engines": {
Expand Down
10 changes: 3 additions & 7 deletions src/tagManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,14 @@ export class TagManager {
let document = editor.document;
let selection = editor.selection;
let word = this.getWordAtPosition(document, selection.active);
if (word) {
this._word = word;
}
this._word = word;
}

private getCurrentWord(event: vscode.TextEditorSelectionChangeEvent): void {
let selection = event.selections[0];
let document = event.textEditor.document;
let word = this.getWordAtPosition(document, selection.active);
if (word) {
this._word = word;
}
this._word = word;
}

private getWordAtPosition(document: vscode.TextDocument, position: vscode.Position): string {
Expand Down Expand Up @@ -140,7 +136,7 @@ export class TagManager {
let startTag: string;
let endTag: string;

if (this._word === newTag.word) {
if (this._word === newTag.word || this._word === null) {
return;
}

Expand Down

0 comments on commit 77a910a

Please sign in to comment.