nit editors

This commit is contained in:
Ruben Fiszel
2024-12-04 07:11:31 +01:00
parent 61d31cc9a7
commit fe75ef0989
7 changed files with 18 additions and 9 deletions
@@ -214,6 +214,7 @@
export let small = false
export let scriptLang: Preview['language'] | 'bunnative'
export let disabled: boolean = false
export let lineNumbersMinChars = 3
const rHash = randomHash()
$: filePath = computePath(path)
@@ -1131,6 +1132,7 @@
...editorConfig(code, lang, automaticLayout, fixedOverflowWidgets),
model,
fontSize: !small ? 14 : 12,
lineNumbersMinChars,
// overflowWidgetsDomNode: widgets,
tabSize: lang == 'python' ? 4 : 2,
folding
@@ -317,9 +317,10 @@
<SplitPanesWrapper>
<Splitpanes class="!overflow-visible">
<Pane size={60} minSize={10} class="!overflow-visible">
<div class="pl-2 h-full !overflow-visible bg-gray-50 dark:bg-[#272D38]">
<div class="h-full !overflow-visible bg-gray-50 dark:bg-[#272D38]">
{#key lang}
<Editor
lineNumbersMinChars={4}
folding
{path}
bind:code
@@ -225,6 +225,8 @@
editor = meditor.create(divEl as HTMLDivElement, {
...editorConfig(code, lang, automaticLayout, fixedOverflowWidgets),
model,
lineDecorationsWidth: 6,
lineNumbersMinChars: 2,
// overflowWidgetsDomNode: widgets,
fontSize: small ? 12 : 14
})
@@ -450,10 +450,11 @@
...editorConfig(code, lang, automaticLayout, fixedOverflowWidgets),
model,
// overflowWidgetsDomNode: widgets,
lineNumbers: 'off',
// lineNumbers: 'on',
lineDecorationsWidth: 6,
lineNumbersMinChars: 2,
fontSize,
suggestOnTriggerCharacters: true,
lineDecorationsWidth: 14
suggestOnTriggerCharacters: true
})
editor.onDidFocusEditorText(() => {
@@ -133,8 +133,9 @@
</div>
{/if}
<button
class="border bg-surface absolute top-0.5 right-2 p-0.5"
on:click={() => (fullscreen = true)}><Maximize2 size={12} /></button
title="Open in drawer"
class="border bg-surface absolute hover:text-primary top-0 right-2 p-0.5 text-secondary"
on:click={() => (fullscreen = true)}><Maximize2 size={10} /></button
>
{#if focus}
<div class="relative w-full">
@@ -303,6 +303,7 @@
{#if !noEditor}
{#key flowModule.id}
<Editor
folding
path={$pathStore + '/' + flowModule.id}
bind:websocketAlive
+4 -3
View File
@@ -12,12 +12,13 @@ export function editorConfig(
automaticLayout,
readOnly: false,
fixedOverflowWidgets,
//lineNumbers: 'off',
lineDecorationsWidth: 15,
lineNumbersMinChars: 2,
lineNumbers: 'on' as const,
lineDecorationsWidth: 10,
lineNumbersMinChars: 3,
scrollbar: { alwaysConsumeMouseWheel: false },
folding: false,
scrollBeyondLastLine: false,
glyphMargin: false,
minimap: {
enabled: false
},