Fix empty node test
This commit is contained in:
@@ -76,8 +76,9 @@ export function findToken(pos: Position, root?: TemplateToken): TokenResult {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the value is an empty node (null, empty string)
|
// If pos, key, and value are on the same line, and value is an empty node (null, empty string) return early
|
||||||
if (emptyNode(value)) {
|
// we cannot reliably check the position in that empty node
|
||||||
|
if (onSameLine(pos, key, value) && emptyNode(value)) {
|
||||||
return {
|
return {
|
||||||
parent: mappingToken,
|
parent: mappingToken,
|
||||||
keyToken: key,
|
keyToken: key,
|
||||||
|
|||||||
Reference in New Issue
Block a user