From ef65b5a1e894e6de721d5e70303946aabbbff555 Mon Sep 17 00:00:00 2001 From: "Ryan J.A. Murphy" Date: Thu, 19 Nov 2020 19:39:24 -0700 Subject: [PATCH] Fixed conflict with default hotkeys for move line up/down --- main.ts | 4 ++-- manifest.json | 2 +- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/main.ts b/main.ts index 1de03f4..1689113 100644 --- a/main.ts +++ b/main.ts @@ -5,7 +5,7 @@ export default class MyPlugin extends Plugin { console.log('Loading the macOS Keyboard Navigation plugin.'); this.registerDomEvent(document, 'keydown', (keyboardPressEvent: KeyboardEvent) => { - if (keyboardPressEvent.getModifierState("Alt")) { + if (keyboardPressEvent.getModifierState("Alt") && !((keyboardPressEvent.getModifierState("Control") || (keyboardPressEvent.getModifierState("Meta"))))) { if (keyboardPressEvent.key == "ArrowUp") { let editor = this.app.workspace.activeLeaf.view.sourceMode.cmEditor; let cursorHead = editor.getCursor("head"); @@ -31,7 +31,7 @@ export default class MyPlugin extends Plugin { }); this.registerDomEvent(document, 'keydown', (keyboardPressEvent: KeyboardEvent) => { - if (keyboardPressEvent.getModifierState("Alt")) { + if (keyboardPressEvent.getModifierState("Alt") && !((keyboardPressEvent.getModifierState("Control") || (keyboardPressEvent.getModifierState("Meta"))))) { if (keyboardPressEvent.key == "ArrowDown") { let editor = this.app.workspace.activeLeaf.view.sourceMode.cmEditor; let cursorHead = editor.getCursor("head"); diff --git a/manifest.json b/manifest.json index 725aa61..3353d00 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "macOS-keyboard-nav-obsidian", "name": "macOS Keyboard Navigation", - "version": "1.1.1", + "version": "1.1.2", "minAppVersion": "0.9.12", "description": "This plugin adds alt+up arrow and alt+down arrow keyboard navigation to Obsidian.", "author": "ryanjamurphy", diff --git a/package.json b/package.json index edf790e..58137b9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "macOS-keyboard-nav-obsidian", - "version": "1.1.1", + "version": "1.1.2", "description": "This plugin adds alt+up arrow and alt+down arrow keyboard navigation to Obsidian.", "main": "main.js", "scripts": {