fix(app): preserve file line endings and UTF-8 BOM (#2277)

* fix(app): preserve file line endings and UTF-8 BOM

* refactor(app): simplify line ending preservation

Let the editor parse newline variants and serialize with the file's first separator. Mixed-ending files become uniform on edit without a separate normalization layer.

---------

Co-authored-by: Mohamed Boudra <boudra.moha@gmail.com>
This commit is contained in:
维她命@
2026-07-23 19:43:09 +02:00
committed by GitHub
co-authored by Mohamed Boudra
parent eb83e2bb45
commit a3438f96f8
8 changed files with 211 additions and 12 deletions
+2
View File
@@ -278,6 +278,8 @@ export interface ExplorerFile {
kind: ExplorerFileKind;
encoding: ExplorerEncoding;
content?: string;
// TextDecoder removes a leading UTF-8 BOM; retain this bit so file writes can restore it.
hasBom: boolean;
mimeType?: string;
size: number;
modifiedAt: string;