mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 20:13:32 +01:00
Emmet Error handling Fixes #29897
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user