Skip to content

Commit e7f5cd4

Browse files
committed
fixes to cell identification
1 parent bba7c9e commit e7f5cd4

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/client/jupyter/common/cells.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,12 @@ export class CellHelper {
2424
});
2525
}
2626

27-
if (cells.length > 1 && index === document.lineCount - 1) {
28-
const previousCell = cells[cells.length - 1];
29-
previousCell.range = new Range(previousCell.range.start, line.range.end);
30-
}
27+
}
28+
29+
if (cells.length >= 1) {
30+
const line = document.lineAt(document.lineCount - 1);
31+
const previousCell = cells[cells.length - 1];
32+
previousCell.range = new Range(previousCell.range.start, line.range.end);
3133
}
3234
return cells;
3335
}

0 commit comments

Comments
 (0)