diff --git a/src/components/FileEditToolDiff.tsx b/src/components/FileEditToolDiff.tsx index 71acf43389..b4ad695165 100644 --- a/src/components/FileEditToolDiff.tsx +++ b/src/components/FileEditToolDiff.tsx @@ -37,6 +37,15 @@ export function FileEditToolDiff(props: Props): React.ReactNode { function DiffBody({ promise, file_path }: { promise: Promise; file_path: string }): React.ReactNode { const { patch, firstLine, fileContent } = use(promise); const { columns } = useTerminalSize(); + + if (patch.length === 0) { + return ( + + No changes to display + + ); + } + return ( - {hunks ? ( + {hunks && hunks.length > 0 ? ( intersperse( hunks.map(_ => ( escapedNewString) } else {