feat(ui/frontend): add shortcuts for tools#871
feat(ui/frontend): add shortcuts for tools#871ShaunSHamilton wants to merge 3 commits intorust-lang:mainfrom
Conversation
|
Could I suggest adding something like |
|
There's also #814 which suggested capturing |
| }, []); | ||
|
|
||
| const shortcutMap = new Map([ | ||
| [['Control', 'Alt', 'f'], handleRustFmt], |
There was a problem hiding this comment.
FWIW, shift+alt+f is the default VSCode shortcut for formatting a document on macOS and Windows (but not Linux, it seems?), so users of the Monaco editor might find that more familiar, although it doesn't use Control like the shortcuts propsed here.
On macOS at least (and I would guess on other OSes as well), some of these shortcuts seem to have uses already within the editor:
cmd+alt+fseems to open a find+replace dialog inaceandmonacocmd+alt+ctoggles case-sensitivity for searches inmonaco
This PR looks like it has been open a while without much movement, but I just wanted to provide some feedback on the choice of shortcuts. If there is any interest in reviving this I think it would definitely be a nice feature to have!
Adds shortcuts to tools. Global event listener is added for the following keydown events:
Ctrl + Alt + fCtrl + Alt + mCtrl + Alt + xCtrl + Alt + cThe above can easily be changed. However, certain combinations are reserved by different browsers.
What this looks like
I realise the background colour from the issue was probably for emphasis. So, am obviously happy to change/remove it.
Closes #844
Aside: More ESLint/editor rules should be added, as I constantly needed to avoid saving with formatting.