Skip to content
This repository has been archived by the owner on Jul 6, 2024. It is now read-only.

Commit

Permalink
Fix potential output issue (NOW I'm tagging 0.3.2)
Browse files Browse the repository at this point in the history
  • Loading branch information
regginator committed Jan 27, 2023
1 parent 8b1da4b commit 66c8093
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/App.lua
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,6 @@ return function(plugin, pluginWidget)
)
end

pcall(function()
ScriptObject.Source = INITIAL_OUTPUT_TEXT
end)

ScriptObject.Parent = Directory
Selection:Set({ScriptObject}) -- Select the script object for the "Save" button feature
ScriptEditorService:OpenScriptDocumentAsync(ScriptObject)
Expand All @@ -332,6 +328,10 @@ return function(plugin, pluginWidget)
-- Yes, this is VERY HACKY, but we have to do this instead due to `Script.Source`'s internal
-- __newindex set limit. We have to escape all "invalid" unicode from strings in the script,
-- or `ScriptDocument:EditTextAsync` will error with a cryptic message to the user
pcall(function()
ScriptObject.Source = INITIAL_OUTPUT_TEXT
end)

local EscapedScript = EscapeUnicode(GeneratedScriptOrError)

local ScriptDocument = ScriptEditorService:FindScriptDocument(ScriptObject)
Expand Down

0 comments on commit 66c8093

Please sign in to comment.