From df5b68a97254c57d28e774aeb3c2eaaca49f3f9b Mon Sep 17 00:00:00 2001 From: Evan Sangaline Date: Sat, 17 Feb 2024 11:56:14 -0600 Subject: [PATCH 1/2] Preserve JSON whitespace. --- libs/remix-ui/workspace/src/lib/actions/workspace.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/remix-ui/workspace/src/lib/actions/workspace.ts b/libs/remix-ui/workspace/src/lib/actions/workspace.ts index be45f3f4d7..dc253702a8 100644 --- a/libs/remix-ui/workspace/src/lib/actions/workspace.ts +++ b/libs/remix-ui/workspace/src/lib/actions/workspace.ts @@ -298,7 +298,9 @@ export const loadWorkspacePreset = async (template: WorkspaceTemplate = 'remixDe } return Object.keys(standardInput.sources)[0] } else { - await workspaceProvider.set(path, JSON.stringify(content)) + // preserve JSON whitepsace if this isn't a Solidity compiler output file + content = data.content + await workspaceProvider.set(path, content) } } catch (e) { console.log(e) From 4ef84e702c9d316631b6f211ebd3f717e8e57afb Mon Sep 17 00:00:00 2001 From: Evan Sangaline Date: Sat, 17 Feb 2024 12:00:49 -0600 Subject: [PATCH 2/2] Make the comment more accurate. --- libs/remix-ui/workspace/src/lib/actions/workspace.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-ui/workspace/src/lib/actions/workspace.ts b/libs/remix-ui/workspace/src/lib/actions/workspace.ts index dc253702a8..8857dbe77e 100644 --- a/libs/remix-ui/workspace/src/lib/actions/workspace.ts +++ b/libs/remix-ui/workspace/src/lib/actions/workspace.ts @@ -298,7 +298,7 @@ export const loadWorkspacePreset = async (template: WorkspaceTemplate = 'remixDe } return Object.keys(standardInput.sources)[0] } else { - // preserve JSON whitepsace if this isn't a Solidity compiler output file + // preserve JSON whitepsace if this isn't a Solidity compiler JSON-input-output file content = data.content await workspaceProvider.set(path, content) }