-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsettings.ts
34 lines (28 loc) · 973 Bytes
/
settings.ts
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
import { PluginSettingTab, Setting, App } from "obsidian";
import { PluginSettings } from "./types";
import MyPlugin from "./main";
import * as Commands from "./commands";
export class SettingsTab extends PluginSettingTab {
plugin: MyPlugin;
constructor(app: App, plugin: MyPlugin) {
super(app, plugin);
this.plugin = plugin;
}
display(): void {
let { containerEl } = this;
containerEl.empty();
containerEl.createEl("h2", { text: "Settings for Extended Multi Cursor." });
// The click enhancer setting
const clickSetting = new Setting(containerEl)
.setName("Enhanced Alt-Click")
.setDesc("Lets you Alt-Click on existing selections to de-select them.")
.addToggle((toggle) =>
toggle
.setValue(this.plugin.settings.clickEnhance)
.onChange(async (value) => {
this.plugin.settings.clickEnhance = value;
await this.plugin.saveSettings();
})
);
}
}