Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add hotkeys tied to Save, Save + Restart #1902

Merged
merged 5 commits into from
Jun 29, 2024

Conversation

kevinkhill
Copy link
Contributor

@kevinkhill kevinkhill commented Jun 9, 2024

Description

I am trying to solve a personal issue of mine with this PR. I compulsively press ctrl+s while making changes in my editor, but this breaks my flow since it launches the save page dialog of the browser.

I propose overriding the default browser behavior for hotkeys with keybindings for our editor actions.

Changes:

  • ctrl+s => Save
  • meta+s => Save (Mac)
  • ctrl+shift+s => Save + Restart
  • meta+shift+s => Save + Restart (Mac)

Screenshots

I could try and make a screen recording of pressing the hotkeys but I didn't feel like it would add much to the PR

@kevinkhill
Copy link
Contributor Author

I left this as a draft because I can't seem to figure out why the save and restart is not working.
When I press ctrl+shift+s it seems to save, but I get a red error notification also.

image

So it is like it is erroring, but also working?

@meteyou
Copy link
Member

meteyou commented Jun 9, 2024

thx for this PR. i think i found your issue. if you press "save & restart", it also trigger the "save" command first. if you change the order from the shortcuts in the dialog, it works fine.

@meteyou
Copy link
Member

meteyou commented Jun 24, 2024

@kevinkhill is there anything missing from your side for this PR? it looks good from to me. feel free to switch it to "ready to review".

@kevinkhill kevinkhill marked this pull request as ready for review June 25, 2024 01:14
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jun 25, 2024
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jun 25, 2024
@meteyou meteyou merged commit 2ab0c87 into mainsail-crew:develop Jun 29, 2024
13 checks passed
@kevinkhill kevinkhill deleted the hotkey-save branch June 30, 2024 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants