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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user