Emmet Error handling Fixes #29897

This commit is contained in:
Ramya Achutha Rao
2017-06-29 18:35:53 -07:00
parent e7de8b2536
commit 0ee00cbd2a
15 changed files with 129 additions and 106 deletions

View File

@@ -11,6 +11,10 @@ export function nextItemHTML(selectionStart: vscode.Position, selectionEnd: vsco
let currentNode = <HtmlNode>getNode(rootNode, selectionEnd);
let nextNode: HtmlNode;
if (!currentNode) {
return;
}
if (currentNode.type !== 'comment') {
// If cursor is in the tag name, select tag
if (selectionEnd.isBefore(currentNode.open.start.translate(0, currentNode.name.length))) {
@@ -53,6 +57,10 @@ export function prevItemHTML(selectionStart: vscode.Position, selectionEnd: vsco
let currentNode = <HtmlNode>getNode(rootNode, selectionStart);
let prevNode: HtmlNode;
if (!currentNode) {
return;
}
if (currentNode.type !== 'comment' && selectionStart.translate(0, -1).isAfter(currentNode.open.start)) {
if (selectionStart.isBefore(currentNode.open.end) || !currentNode.firstChild) {