Skip to content

Commit bf6187c

Browse files
committed
fix: Remove default hotkeys for "Open insert template modal", "Replace templates in the active file", and "Create new note from template" commands on MacOS since they don't work
Keeping hotkeys for other platforms to avoid breaking changes in workflows and tutorials. refs: #1491
1 parent 68e5d6e commit bf6187c

File tree

1 file changed

+25
-18
lines changed

1 file changed

+25
-18
lines changed

src/handlers/CommandHandler.ts

+25-18
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import TemplaterPlugin from "main";
2+
import { Platform } from "obsidian";
23
import { errorWrapperSync } from "utils/Error";
34
import { resolve_tfile } from "utils/Utils";
45

@@ -10,12 +11,14 @@ export class CommandHandler {
1011
id: "insert-templater",
1112
name: "Open insert template modal",
1213
icon: "templater-icon",
13-
hotkeys: [
14-
{
15-
modifiers: ["Alt"],
16-
key: "e",
17-
},
18-
],
14+
hotkeys: Platform.isMacOS
15+
? undefined
16+
: [
17+
{
18+
modifiers: ["Alt"],
19+
key: "e",
20+
},
21+
],
1922
callback: () => {
2023
this.plugin.fuzzy_suggester.insert_template();
2124
},
@@ -25,12 +28,14 @@ export class CommandHandler {
2528
id: "replace-in-file-templater",
2629
name: "Replace templates in the active file",
2730
icon: "templater-icon",
28-
hotkeys: [
29-
{
30-
modifiers: ["Alt"],
31-
key: "r",
32-
},
33-
],
31+
hotkeys: Platform.isMacOS
32+
? undefined
33+
: [
34+
{
35+
modifiers: ["Alt"],
36+
key: "r",
37+
},
38+
],
3439
callback: () => {
3540
this.plugin.templater.overwrite_active_file_commands();
3641
},
@@ -55,12 +60,14 @@ export class CommandHandler {
5560
id: "create-new-note-from-template",
5661
name: "Create new note from template",
5762
icon: "templater-icon",
58-
hotkeys: [
59-
{
60-
modifiers: ["Alt"],
61-
key: "n",
62-
},
63-
],
63+
hotkeys: Platform.isMacOS
64+
? undefined
65+
: [
66+
{
67+
modifiers: ["Alt"],
68+
key: "n",
69+
},
70+
],
6471
callback: () => {
6572
this.plugin.fuzzy_suggester.create_new_note_from_template();
6673
},

0 commit comments

Comments
 (0)