Skip to content

Commit

Permalink
Misc. bug fixes
Browse files Browse the repository at this point in the history
- Certain HH commands not working (#15)
- Command Palette instructions not displaying correctly on newer Obsidian versions
  • Loading branch information
pjeby committed Oct 26, 2024
1 parent 0182f9f commit e5c9756
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "hotkey-helper",
"name": "Hotkey Helper",
"version": "0.3.19",
"version": "0.3.20",
"minAppVersion": "1.5.8",
"description": "Easily see and access any plugin's settings or hotkey assignments (and conflicts) from the Community Plugins tab",
"author": "PJ Eby",
Expand Down
28 changes: 16 additions & 12 deletions src/hotkey-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
ExtraButtonComponent, Hotkey, Command, SearchComponent
} from "obsidian";
import {around, serialize} from "monkey-around";
import {defer, modalSelect, onElement} from "@ophidian/core";
import {defer, modalSelect, onElement, use, app} from "@ophidian/core";
import "./obsidian-internals";
import "../styles.css";

Expand Down Expand Up @@ -66,6 +66,8 @@ export default class HotkeyHelper extends Plugin {
lastTabId: string;
currentViewer: Modal;

use = use.plugin(this);

onload() {
const workspace = this.app.workspace, plugin = this, events = workspace as Events;
this.registerEvent(events.on("plugin-settings:before-display", (settingsTab, tabId) => {
Expand Down Expand Up @@ -120,14 +122,17 @@ export default class HotkeyHelper extends Plugin {
}));
const first = cmdPalette.modalEl.find(".prompt-instructions .prompt-instruction");
if (first) {
createDiv("prompt-instruction", d => {
d.createSpan({
cls: "prompt-instruction-command", text: Keymap.compileModifiers(["Mod"])+"+↵"
});
d.appendText(" ");
d.createSpan({text: "to configure hotkey(s)"})
this.register(() => d.detach());
}).insertAfter(first);
first.parentNode.insertBefore(
createDiv("prompt-instruction", d => {
d.createSpan({
cls: "prompt-instruction-command", text: Keymap.compileModifiers(["Mod"])+"+↵"
});
d.appendText(" ");
d.createSpan({text: "to configure hotkey(s)"})
this.register(() => d.detach());
}),
null
)
}
}

Expand Down Expand Up @@ -228,8 +233,7 @@ export default class HotkeyHelper extends Plugin {
"Select a plugin to open its settings...",
);
if (item) {
app.setting.open()
app.setting.openTabById(item.id);
this.showSettings(item.id);
}
}
});
Expand Down Expand Up @@ -518,7 +522,7 @@ export default class HotkeyHelper extends Plugin {
return;
}

this.showSettings("community-plugins");
if (!this.showSettings("community-plugins")) return;
const remove = around(Modal.prototype, {
open(old) {
return function(...args) {
Expand Down
2 changes: 1 addition & 1 deletion versions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"0.3.19": "1.5.8",
"0.3.20": "1.5.8",
"0.3.18": "1.2.8",
"0.3.17": "1.1.16",
"0.3.16": "0.15.9",
Expand Down

0 comments on commit e5c9756

Please sign in to comment.