Skip to content

Commit 29b7ad2

Browse files
authored
Fix NAN for edits in notebook (microsoft#242263)
1 parent cad9007 commit 29b7ad2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ export class ChatEditingModifiedNotebookEntry extends AbstractChatEditingModifie
740740
}, 0);
741741

742742
const totalNumberOfLines = this.modifiedModel.cells.reduce((totalLines, cell) => totalLines + (cell.textModel?.getLineCount() ?? 0), 0);
743-
return Math.min(1, totalNumberOfUpdatedLines / totalNumberOfLines);
743+
return totalNumberOfLines === 0 ? 0 : Math.min(1, totalNumberOfUpdatedLines / totalNumberOfLines);
744744
}
745745

746746
override createSnapshot(requestId: string | undefined, undoStop: string | undefined): ISnapshotEntry {

0 commit comments

Comments
 (0)