Skip to content

Commit

Permalink
Fixed conflict with default hotkeys for move line up/down
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan J.A. Murphy committed Nov 20, 2020
1 parent a7db86e commit ef65b5a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -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",
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": "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": {
Expand Down

0 comments on commit ef65b5a

Please sign in to comment.