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

Handle ctrl+S in monaco editor #1033

Closed
kirjs opened this issue Sep 7, 2019 · 6 comments
Closed

Handle ctrl+S in monaco editor #1033

kirjs opened this issue Sep 7, 2019 · 6 comments

Comments

@kirjs
Copy link
Collaborator

kirjs commented Sep 7, 2019

While we run the code on every keystroke, lot of user still hit ctrl+S by instinct and get a file save dialog.

We should prevent the dialog from showing, and maybe show some little animation saying everything is saved (so that the user feels nice)

@kirjs
Copy link
Collaborator Author

kirjs commented Sep 7, 2019

To reproduce go to https://codelab.fun/angular/typescript/typescript-why-ts and hit ctrl+s

@jatinAroraGit
Copy link

Hey there,
I would like to work on this.

@NothingEverHappens
Copy link
Collaborator

Hey @jatinAroraGit that's awesome, I'm not exactly sure what would be the best way to handle this.

The global configuration is here:

MonacoConfigService.configureMonaco();

The actual editor instantiation happens here:

return this.monacoConfigService.monaco.editor.create(el, {

Feel free to ping this thread if you're stuck at any point or with any other questions

@jatinAroraGit
Copy link

Hey @NothingEverHappens,
So I have figured out most of it and have stopped popping of Save Window. Currently nothing is being displayed on pressing Ctrl+S, Do you want me to implement something to show ctrl+s doing something (like one of those alert boxes with message 'Saved' ) or leave it as it is ?

@kirjs
Copy link
Collaborator Author

kirjs commented Oct 6, 2019

How about if anything was changed, we can show a snack bar saying everything was saved successfully?

https://material.angular.io/components/snack-bar/overview

@jatinAroraGit
Copy link

Sounds good, @kirjs .

@kirjs kirjs closed this as completed in 3afd8e0 Oct 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants