From 18f1b251aba06e6de5cc60039fce9e946cc91d5f Mon Sep 17 00:00:00 2001 From: KevIsDev Date: Mon, 9 Jun 2025 13:10:21 +0100 Subject: [PATCH] fix: add binary file detection support Add isBinary flag to editor documents to handle binary files appropriately Update BinaryContent component styling to display properly in the editor --- app/components/editor/codemirror/BinaryContent.tsx | 2 +- app/lib/stores/editor.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/components/editor/codemirror/BinaryContent.tsx b/app/components/editor/codemirror/BinaryContent.tsx index 0a425116..04d40753 100644 --- a/app/components/editor/codemirror/BinaryContent.tsx +++ b/app/components/editor/codemirror/BinaryContent.tsx @@ -1,6 +1,6 @@ export function BinaryContent() { return ( -
+
File format cannot be displayed.
); diff --git a/app/lib/stores/editor.ts b/app/lib/stores/editor.ts index 1a66c390..5d483232 100644 --- a/app/lib/stores/editor.ts +++ b/app/lib/stores/editor.ts @@ -50,6 +50,7 @@ export class EditorStore { { value: dirent.content, filePath, + isBinary: dirent.isBinary, // Add this line scroll: previousDocument?.scroll, }, ] as [string, EditorDocument];