提交 c5236eeb 编写于 作者: N Nagaraj

Fixing warning while executing expand select action on an empty page - Nagaraj

上级 9dda9f2e
......@@ -57,6 +57,10 @@ export class NodeList extends Node {
return this.children && this.children.length > 0;
}
get isEmpty() {
return !this.hasChildren && !this.parent;
}
public append(node: Node): boolean {
if (!node) {
return false;
......@@ -360,6 +364,9 @@ export function build(model: IModel): Node {
}
export function find(node: Node, position: IPosition): Node {
if (node instanceof NodeList && node.isEmpty) {
return null;
}
if (!Range.containsPosition(node.range, position)) {
return null;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册