File tree Expand file tree Collapse file tree 4 files changed +14
-12
lines changed
Expand file tree Collapse file tree 4 files changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -64,20 +64,21 @@ export default class EditorScrollCommandsPlugin extends Plugin {
6464
6565 isScrollHotkeyEvent ( event : KeyboardEvent , hotkeys : Hotkey [ ] ) {
6666 return hotkeys ?. some ( ( hotkey : Hotkey ) => {
67- let keyMatched =
68- ( hotkey . key == event . code ) ||
69- ( 'Key' + hotkey . key == event . code ) ;
70-
71- if ( ! keyMatched ) { return false ; }
67+ if ( ( hotkey . key != event . code ) &&
68+ ( 'Key' + hotkey . key != event . code ) ) { return false ; }
7269
7370 let mods = hotkey . modifiers ;
74- let modKeyState = Platform . isMacOS ? event . metaKey : event . ctrlKey ;
7571
7672 if ( event . altKey != mods . contains ( 'Alt' ) ) { return false ; }
77- if ( event . ctrlKey != mods . contains ( 'Ctrl' ) ) { return false ; }
7873 if ( event . shiftKey != mods . contains ( 'Shift' ) ) { return false ; }
79- if ( event . metaKey != mods . contains ( 'Meta' ) ) { return false ; }
80- if ( modKeyState != mods . contains ( 'Mod' ) ) { return false ; }
74+
75+ if ( Platform . isMacOS ) {
76+ if ( event . metaKey != ( mods . contains ( 'Mod' ) || mods . contains ( 'Meta' ) ) )
77+ { return false ; }
78+ } else {
79+ if ( event . ctrlKey != ( mods . contains ( 'Mod' ) || mods . contains ( 'Ctrl' ) ) )
80+ { return false ; }
81+ }
8182
8283 return true ;
8384 } ) ;
Original file line number Diff line number Diff line change 11{
22 "id" : " editor-scroll-commands" ,
33 "name" : " Editor Scroll Commands" ,
4- "version" : " 1.1.2 " ,
4+ "version" : " 1.1.3 " ,
55 "minAppVersion" : " 0.15.0" ,
66 "description" : " Add scroll commands for editor, so you can assign hotkeys." ,
77 "author" : " Andrey Sorokin <pho.nzp@gmail.com>" ,
Original file line number Diff line number Diff line change 11{
22 "name" : " editor-scroll-commands" ,
3- "version" : " 1.1.2 " ,
3+ "version" : " 1.1.3 " ,
44 "description" : " Add scroll commands for editor, so you can assign hotkeys." ,
55 "main" : " main.js" ,
66 "scripts" : {
Original file line number Diff line number Diff line change 33 "1.0.3" : " 0.15.0" ,
44 "1.1.0" : " 0.15.0" ,
55 "1.1.1" : " 0.15.0" ,
6- "1.1.2" : " 0.15.0"
6+ "1.1.2" : " 0.15.0" ,
7+ "1.1.3" : " 0.15.0"
78}
You can’t perform that action at this time.
0 commit comments