pyret-embed 0.0.26 → 0.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -666,11 +666,17 @@
666
666
 
667
667
  // save
668
668
  // On Mac mod ends up mapping to command+s whereas on Windows and Linux it maps to ctrl+s.
669
- Mousetrap.bindGlobal('mod+s', function(e) {
670
- CPO.save();
671
- e.stopImmediatePropagation();
672
- e.preventDefault();
673
- });
669
+ // Saving has a special condition: when embedded we want the Ctrl-S to
670
+ // propagate up. We could fire a special “save” event, but for contexts
671
+ // like VScode it is nice to have the “real” Cmd-S event fire to get
672
+ // good default behavior
673
+ if(!PYRET_IS_EMBEDDED) {
674
+ Mousetrap.bindGlobal('mod+s', function(e) {
675
+ CPO.save();
676
+ e.stopImmediatePropagation();
677
+ e.preventDefault();
678
+ });
679
+ }
674
680
 
675
681
  // resize, Toggle sizing of the editor window between 50% and last resize
676
682
  Mousetrap.bindGlobal('ctrl+m', function(e){
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pyret-embed",
3
- "version": "0.0.26",
3
+ "version": "0.0.28",
4
4
  "description": "A library for embedding Pyret into webpages",
5
5
  "main": "dist/pyret.js",
6
6
  "files": [