+
)}
diff --git a/src/vs/workbench/contrib/void/browser/react/src/util/inputs.tsx b/src/vs/workbench/contrib/void/browser/react/src/util/inputs.tsx
index 557d4dca..260f8c75 100644
--- a/src/vs/workbench/contrib/void/browser/react/src/util/inputs.tsx
+++ b/src/vs/workbench/contrib/void/browser/react/src/util/inputs.tsx
@@ -299,6 +299,7 @@ export const VoidCodeEditor = ({ initValue, language }: { initValue: string, lan
return
instantiationService.createInstance(
CodeEditorWidget,
@@ -306,22 +307,34 @@ export const VoidCodeEditor = ({ initValue, language }: { initValue: string, lan
{
automaticLayout: true,
wordWrap: 'off',
+
scrollbar: {
+ alwaysConsumeMouseWheel: false,
vertical: 'auto',
horizontal: 'auto',
- alwaysConsumeMouseWheel: false
},
+ scrollBeyondLastLine: false,
+
lineNumbers: 'off',
+
+ readOnly: true,
+ domReadOnly: true,
+ readOnlyMessage: { value: '' },
+
+ minimap: {
+ enabled: false,
+ // maxColumn: 0,
+ },
+
+ selectionHighlight: false, // highlights whole words
+ renderLineHighlight: 'none',
+
folding: false,
lineDecorationsWidth: 0,
- scrollBeyondLastLine: false,
- minimap: { enabled: false },
overviewRulerLanes: 0,
hideCursorInOverviewRuler: true,
overviewRulerBorder: false,
- renderLineHighlight: 'none',
glyphMargin: false,
- readOnly: true,
},
{
isSimpleWidget: true,
diff --git a/src/vs/workbench/contrib/void/browser/voidSettingsPane.ts b/src/vs/workbench/contrib/void/browser/voidSettingsPane.ts
index b1fc7372..51803ce2 100644
--- a/src/vs/workbench/contrib/void/browser/voidSettingsPane.ts
+++ b/src/vs/workbench/contrib/void/browser/voidSettingsPane.ts
@@ -35,10 +35,11 @@ class VoidSettingsInput extends EditorInput {
static readonly ID: string = 'workbench.input.void.settings';
- readonly resource = URI.from({
- scheme: 'void-editor-settings',
- path: 'void-settings' // Give it a unique path
- });
+ static readonly RESOURCE = URI.from({ // I think this scheme is invalid, it just shuts up TS
+ scheme: 'void', // Custom scheme for our editor
+ path: 'settings'
+ })
+ readonly resource = VoidSettingsInput.RESOURCE;
constructor() {
super();
@@ -140,9 +141,20 @@ registerAction2(class extends Action2 {
]
});
}
+
async run(accessor: ServicesAccessor): Promise {
const editorService = accessor.get(IEditorService);
const instantiationService = accessor.get(IInstantiationService);
+
+ const openEditors = editorService.findEditors(VoidSettingsInput.RESOURCE);
+
+ // close all instances if found
+ if (openEditors.length > 0) {
+ await editorService.closeEditors(openEditors);
+ return;
+ }
+
+ // else open it
const input = instantiationService.createInstance(VoidSettingsInput);
await editorService.openEditor(input);
}