Fix reading files from WebAssembly (#4183)

This commit is contained in:
Jonathan Tran
2024-10-18 10:43:01 -04:00
committed by GitHub
parent 5332ddd88e
commit 19ffa220e8
8 changed files with 115 additions and 9 deletions

View File

@ -140,7 +140,7 @@ const FileTreeItem = ({
async (eventType, path) => {
// Don't try to read a file that was removed.
if (isCurrentFile && eventType !== 'unlink') {
let code = await window.electron.readFile(path)
let code = await window.electron.readFile(path, { encoding: 'utf-8' })
code = normalizeLineEndings(code)
codeManager.updateCodeStateEditor(code)
}