Skip to content

Commit

Permalink
Fixed Double-key registry bug of not unregistering events when switch…
Browse files Browse the repository at this point in the history
…ing preset, prepared files for fix release 2.0.1
  • Loading branch information
KrazyManJ committed May 5, 2023
1 parent e7acd74 commit 9998519
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "keyshots",
"name": "Keyshots",
"version": "2.0.0",
"version": "2.0.1",
"minAppVersion": "0.15.0",
"description": "Adds classic hotkey/shortcuts commands from popular IDEs like Visual Studio Code or JetBrains Family.",
"author": "KrazyManJ",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "obsidian-keyshots",
"version": "2.0.0",
"version": "2.0.1",
"description": "",
"main": "main.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ export default class KeyshotsPlugin extends Plugin {
async onload() {
await this.loadSettings()
this.addSettingTab(new KeyshotsSettingTab(this.app, this))
this.loadCommands()
this.doubleKeyRegistry = new DoubleKeyRegistry(this)
this.loadDoubleKeyCommands()
this.loadCommands()
}

loadCommands() {
if (this.commandIds !== undefined) {
if (!this.settings.carets_via_double_ctrl) return;
this.commandIds.forEach(cmd => this.app.commands.removeCommand(cmd))
this._events.splice(1)
this._events.splice(5)
}
this.commandIds = new Set(COMMANDS(this, mapBySettings(this)).map(cmd => this.addCommand(cmd).id));
}
Expand Down
3 changes: 2 additions & 1 deletion versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"1.3.0": "0.15.0",
"1.4.0": "0.15.0",
"1.5.0": "0.15.0",
"2.0.0": "0.15.0"
"2.0.0": "0.15.0",
"2.0.1": "0.15.0"
}

0 comments on commit 9998519

Please sign in to comment.