mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-28 04:23:32 +01:00
Save: Flush to disk after writing to file (fixes #9589)
This commit is contained in:
@@ -272,13 +272,13 @@ export class FileService implements IFileService {
|
||||
|
||||
// Write fast if we do UTF 8 without BOM
|
||||
if (!addBom && encodingToWrite === encoding.UTF8) {
|
||||
writeFilePromise = pfs.writeFile(absolutePath, value, encoding.UTF8);
|
||||
writeFilePromise = pfs.writeFileAndFlush(absolutePath, value, encoding.UTF8);
|
||||
}
|
||||
|
||||
// Otherwise use encoding lib
|
||||
else {
|
||||
let encoded = encoding.encode(value, encodingToWrite, { addBOM: addBom });
|
||||
writeFilePromise = pfs.writeFile(absolutePath, encoded);
|
||||
writeFilePromise = pfs.writeFileAndFlush(absolutePath, encoded);
|
||||
}
|
||||
|
||||
// 4.) set contents
|
||||
|
||||
Reference in New Issue
Block a user