From 3d482219ab5ea75ca8fbb7a2f0028d468abfc86c Mon Sep 17 00:00:00 2001 From: Jason Dreyzehner Date: Thu, 5 Sep 2024 13:23:07 -0400 Subject: [PATCH] Split tokens from imported scripts with new lines --- .../dialogs/import-script-dialog/ImportScriptDialog.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/editor/dialogs/import-script-dialog/ImportScriptDialog.tsx b/src/editor/dialogs/import-script-dialog/ImportScriptDialog.tsx index 5f6c8af..a1284e0 100644 --- a/src/editor/dialogs/import-script-dialog/ImportScriptDialog.tsx +++ b/src/editor/dialogs/import-script-dialog/ImportScriptDialog.tsx @@ -5,7 +5,7 @@ import { ActiveDialog } from '../../../state/types'; import { createInsecureUuidV4 } from '../../../utils'; import { toConventionalId } from '../../common'; -import { disassembleBytecodeBCH, hexToBin } from '@bitauth/libauth'; +import { disassembleBytecodeBch, hexToBin } from '@bitauth/libauth'; import { Button, Classes, @@ -16,7 +16,7 @@ import { import { WarningSign } from '@blueprintjs/icons'; import React, { useState } from 'react'; -const disassembleHex = (hex: string) => disassembleBytecodeBCH(hexToBin(hex)); +const disassembleHex = (hex: string) => disassembleBytecodeBch(hexToBin(hex)); const tokenizeHex = (hex: string) => { const splitAtErrors = disassembleHex(hex).split('['); return [ @@ -151,7 +151,10 @@ export const ImportScriptDialog = ({ id: scriptId, internalId: createInsecureUuidV4(), type: 'isolated', - contents: disassembleHex(bytecode).split('[')[0], + contents: disassembleHex(bytecode) + .split('[')[0]! + .split(' ') + .join('\n'), }); closeDialog(); }