Skip to content

Commit

Permalink
Fix shortcut key for node blur on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
shaunhurryup committed Aug 30, 2023
1 parent ede8998 commit 7a90216
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ In Navigation view, `f` activate selection node and start editing.

## 🚧 TODO

- [ ] Delete node by shortcut `Delete`
- [ ] Canvas should only be applied in active graph

- [ ] Double `f` create node in the middle if no node in viewport

Expand Down
14 changes: 14 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,20 @@ export default class LovelyMindmap extends Plugin{
this.addSettingTab(new Setting(this))
this.keymap.registerAll()
this.createCanvasInstance()

// fixed: blur node doesn't work
// @see https://github.com/xincan1949/lovely-mindmap/issues/1#issue-1868166056
this.addCommand({
id: 'blurNode',
name: 'Blur node',
hotkeys: [
{
modifiers: ['Mod'],
key: 'Escape',
},
],
checkCallback: () => this.keymap.blurNode(),
});
}

onunload() {
Expand Down
1 change: 0 additions & 1 deletion src/module/keymap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ class Keymap {
registerAll() {
this.hotkeys.push(
this.register([], 'f', this.focusNode),
this.register(['Meta'], 'Escape', this.blurNode),
this.register([], 'Tab', this.main.node.createChildren),
this.register([], 'enter', this.main.node.createSibNode),
this.register(['Shift'], 'enter', this.main.node.createSibNode),
Expand Down

0 comments on commit 7a90216

Please sign in to comment.