Skip to content

Commit b570f22

Browse files
author
aiday-mar
committed
Don't need the config file, accessing directly the editor settings
1 parent 5d634d5 commit b570f22

File tree

2 files changed

+8
-90
lines changed

2 files changed

+8
-90
lines changed

src/vs/editor/contrib/stickyScroll/browser/stickyScrollConfig.ts

Lines changed: 0 additions & 82 deletions
This file was deleted.

src/vs/editor/contrib/stickyScroll/browser/stickyScrollController.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import { localize } from 'vs/nls';
1717
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
1818
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
1919
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
20-
import { StickyScrollConfig } from './stickyScrollConfig';
2120

2221
class StickyScrollController extends Disposable implements IEditorContribution {
2322

@@ -149,26 +148,27 @@ registerAction2(class ToggleStickyScroll extends Action2 {
149148

150149
constructor() {
151150
super({
152-
id: 'stickyScroll.toggle',
151+
id: 'editor.action.toggleStickyScroll',
153152
title: {
154-
value: localize('cmd.toggle', "Toggle Sticky Scroll"),
153+
value: localize('toggleStickyScroll', "Toggle Sticky Scroll"),
155154
mnemonicTitle: localize('miStickyScroll', "&&Sticky Scroll"),
156155
original: 'Toggle Sticky Scroll',
157156
},
158157
// Hardcoding due to import violation
159158
category: { value: localize('view', "View"), original: 'View' },
160-
toggled: ContextKeyExpr.equals('config.stickyScroll.enabled', true),
159+
f1: true,
160+
toggled: ContextKeyExpr.equals('config.editor.stickyScroll.enabled', true),
161161
menu: [
162162
{ id: MenuId.CommandPalette },
163163
{ id: MenuId.MenubarViewMenu, group: '5_editor', order: 6 },
164164
]
165165
});
166166
}
167167

168-
run(accessor: ServicesAccessor): void {
169-
const config = accessor.get(IConfigurationService);
170-
const value = StickyScrollConfig.IsEnabled.bindTo(config).getValue();
171-
StickyScrollConfig.IsEnabled.bindTo(config).updateValue(!value);
168+
override async run(accessor: ServicesAccessor): Promise<void> {
169+
const configurationService = accessor.get(IConfigurationService);
170+
const newValue = !configurationService.getValue('editor.experimental.stickyScroll.enabled');
171+
return configurationService.updateValue('editor.experimental.stickyScroll.enabled', newValue);
172172
}
173173
});
174174

0 commit comments

Comments
 (0)