From 2271b5130e38b8bc5250ad79dc58e668f290d81a Mon Sep 17 00:00:00 2001 From: ThinLiquid Date: Mon, 16 Oct 2023 14:24:37 +0100 Subject: [PATCH] =?UTF-8?q?[=E2=9C=A8]=20Added=20file=20contents=20to=20co?= =?UTF-8?q?de=20editor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apps/editor.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/apps/editor.ts b/src/apps/editor.ts index bafb906..4898b68 100644 --- a/src/apps/editor.ts +++ b/src/apps/editor.ts @@ -35,17 +35,16 @@ export default class EditorApp implements App { if (data) { win.setTitle('Editor - ' + data.path); + const value = (await fs.promises.readFile(data.path)).toString() const editor = fullEditor( Prism, win.content, { language: data.path.split('.').at(-1), theme: "github-dark", + value }, ); - - console.log(editor) - editor.scrollContainer.setAttribute('style', 'height: 100%;'); const style = document.createElement('style'); style.innerHTML = ` .prism-editor { @@ -72,6 +71,7 @@ export default class EditorApp implements App { --editor__bg-fold: #768390; --bg-guide-indent: var(--surface-0); color-scheme: dark; + height: 100%; } .prism-search * { font-family: 'Satoshi', sans-serif;