From 3c5aec27c3c4f6be61ad15770badd6f776d026a7 Mon Sep 17 00:00:00 2001 From: ochafik Date: Mon, 27 Mar 2023 01:27:09 +0100 Subject: [PATCH] Hide line numbers by default --- src/components/EditorPanel.tsx | 2 ++ src/components/SettingsMenu.tsx | 6 ++++++ src/state/app-state.ts | 1 + src/state/fragment-state.ts | 1 + 4 files changed, 10 insertions(+) diff --git a/src/components/EditorPanel.tsx b/src/components/EditorPanel.tsx index 1efbf06..b7523f1 100644 --- a/src/components/EditorPanel.tsx +++ b/src/components/EditorPanel.tsx @@ -193,6 +193,8 @@ export default function EditorPanel({className, style}: {className?: string, sty onMount={onMount} // TODO: This looks a bit silly, does it trigger a re-render?? options={{ ...openscadEditorOptions, + + lineNumbers: state.view.lineNumbers ? 'on' : 'off', // readOnly: !isFileWritable(state.params.sourcePath) }} /> diff --git a/src/components/SettingsMenu.tsx b/src/components/SettingsMenu.tsx index 9b5ca27..89b646e 100644 --- a/src/components/SettingsMenu.tsx +++ b/src/components/SettingsMenu.tsx @@ -38,6 +38,12 @@ export default function SettingsMenu({className, style}: {className?: string, st // disabled: true, command: () => model.mutate(s => s.view.showShadows = !s.view.showShadows) }, + { + label: state.view.lineNumbers ? 'Hide line numbers' : 'Show line numbers', + icon: 'pi pi-list', + // disabled: true, + command: () => model.mutate(s => s.view.lineNumbers = !s.view.lineNumbers) + }, ] as MenuItem[]} popup ref={settingsMenu} />