Skip to content

Commit bf79c75

Browse files
committed
fix: SelectionParser.parse error for UntypedTarget
1 parent efae6c9 commit bf79c75

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/generate-examples/src/lib/generateHtml.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,14 @@ class SelectionParser {
177177
}
178178

179179
parse(selection: CursorlessFixtureSelection) {
180-
const { anchor: start, active: end } = selection;
180+
let start, end;
181+
if (selection.type === 'UntypedTarget') {
182+
start = selection.contentRange.start.line;
183+
end = selection.contentRange.end.line;
184+
} else {
185+
start = selection.anchor.line;
186+
end = selection.active.line;
187+
}
181188
for (let l = end.line; l <= start.line; l += 1) {
182189
if (l !== end.line && l !== start.line) {
183190
this.handleInsideLine(l);

0 commit comments

Comments
 (0)