[✨] Added file contents to code editor
This commit is contained in:
parent
358696b845
commit
2271b5130e
1 changed files with 3 additions and 3 deletions
|
|
@ -35,17 +35,16 @@ export default class EditorApp implements App {
|
||||||
if (data) {
|
if (data) {
|
||||||
win.setTitle('Editor - ' + data.path);
|
win.setTitle('Editor - ' + data.path);
|
||||||
|
|
||||||
|
const value = (await fs.promises.readFile(data.path)).toString()
|
||||||
const editor = fullEditor(
|
const editor = fullEditor(
|
||||||
Prism,
|
Prism,
|
||||||
win.content,
|
win.content,
|
||||||
{
|
{
|
||||||
language: data.path.split('.').at(-1),
|
language: data.path.split('.').at(-1),
|
||||||
theme: "github-dark",
|
theme: "github-dark",
|
||||||
|
value
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
console.log(editor)
|
|
||||||
editor.scrollContainer.setAttribute('style', 'height: 100%;');
|
|
||||||
const style = document.createElement('style');
|
const style = document.createElement('style');
|
||||||
style.innerHTML = `
|
style.innerHTML = `
|
||||||
.prism-editor {
|
.prism-editor {
|
||||||
|
|
@ -72,6 +71,7 @@ export default class EditorApp implements App {
|
||||||
--editor__bg-fold: #768390;
|
--editor__bg-fold: #768390;
|
||||||
--bg-guide-indent: var(--surface-0);
|
--bg-guide-indent: var(--surface-0);
|
||||||
color-scheme: dark;
|
color-scheme: dark;
|
||||||
|
height: 100%;
|
||||||
}
|
}
|
||||||
.prism-search * {
|
.prism-search * {
|
||||||
font-family: 'Satoshi', sans-serif;
|
font-family: 'Satoshi', sans-serif;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue