-
Notifications
You must be signed in to change notification settings - Fork 0
/
extension.js
38 lines (28 loc) · 1.13 KB
/
extension.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
const vscode = require('vscode');
function activate(context) {
let editorConfig = vscode.workspace.getConfiguration('editor');
let makeDefault = vscode.commands.registerCommand('code-zoom.default', () => {
editorConfig.update('fontSize');
editorConfig.update('lineHeight');
});
let makeSmall = vscode.commands.registerCommand('code-zoom.small', () => {
let codeZoomConfig = vscode.workspace.getConfiguration('code-zoom');
editorConfig.update('fontSize', codeZoomConfig.get('small.fontSize', 12));
editorConfig.update('lineHeight', codeZoomConfig.get('small.lineHeight', 1.25));
});
let makeBig = vscode.commands.registerCommand('code-zoom.big', () => {
let codeZoomConfig = vscode.workspace.getConfiguration('code-zoom');
editorConfig.update('fontSize', codeZoomConfig.get('big.fontSize', 32));
editorConfig.update('lineHeight', codeZoomConfig.get('big.lineHeight', 4));
});
context.subscriptions.push(makeDefault, makeSmall, makeBig);
}
function deactivate() {
let config = vscode.workspace.getConfiguration('editor');
config.update('fontSize');
config.update('lineHeight');
}
module.exports = {
activate,
deactivate
}