From a360be9d44303233827b121da4f04e7afd84f1f1 Mon Sep 17 00:00:00 2001 From: PJ Date: Sun, 4 Jun 2023 04:52:48 -0400 Subject: [PATCH] Fix #12 - Opening plugins from command palette --- manifest.json | 4 ++-- ophidian.config.mjs | 2 +- src/hotkey-helper.ts | 5 +++-- versions.json | 1 + 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/manifest.json b/manifest.json index c1b3a00..5a4a5c5 100644 --- a/manifest.json +++ b/manifest.json @@ -1,8 +1,8 @@ { "id": "hotkey-helper", "name": "Hotkey Helper", - "version": "0.3.17", - "minAppVersion": "0.15.9", + "version": "0.3.18", + "minAppVersion": "1.2.8", "description": "Easily see and access any plugin's settings or hotkey assignments (and conflicts) from the Community Plugins tab", "author": "PJ Eby", "authorUrl": "https://github.com/pjeby" diff --git a/ophidian.config.mjs b/ophidian.config.mjs index c083dd9..7b52bde 100644 --- a/ophidian.config.mjs +++ b/ophidian.config.mjs @@ -1,7 +1,7 @@ import Builder from "@ophidian/build"; new Builder("src/hotkey-helper.ts") -.withCss() +.withSass() .withInstall() .build(); diff --git a/src/hotkey-helper.ts b/src/hotkey-helper.ts index fb93143..ef648a9 100644 --- a/src/hotkey-helper.ts +++ b/src/hotkey-helper.ts @@ -5,6 +5,7 @@ import { import {around, serialize} from "monkey-around"; import {defer, modalSelect, onElement} from "@ophidian/core"; import "./obsidian-internals"; +import "../styles.css"; interface OldPluginViewer extends Modal { // pre 1.0 autoopen?: string @@ -299,7 +300,7 @@ export default class HotkeyHelper extends Plugin { tmp.settingEl.detach(); } if (tabId === "community-plugins") { - searchEl.inputEl.addEventListener("keyup", e => { + searchEl.inputEl.addEventListener("keydown", e => { if (e.keyCode === 13 && !Keymap.getModifiers(e)) { this.gotoPlugin(); return false; @@ -535,7 +536,7 @@ export default class HotkeyHelper extends Plugin { this.currentViewer?.close(); // close the plugin browser if open settingsAreOpen() || app.setting.open(); if (id) { - app.setting.openTabById(id); + if (app.setting.activeTab?.id !== id) app.setting.openTabById(id); return app.setting.activeTab?.id === id ? app.setting.activeTab : false } } diff --git a/versions.json b/versions.json index e772a37..2e990ae 100644 --- a/versions.json +++ b/versions.json @@ -1,4 +1,5 @@ { + "0.3.18": "1.2.8", "0.3.17": "1.1.16", "0.3.16": "0.15.9", "0.3.11": "0.13.19",