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.
@@ -314541,11 +314541,17 @@ ${labelRow}`;
314541
314541
 
314542
314542
  // save
314543
314543
  // On Mac mod ends up mapping to command+s whereas on Windows and Linux it maps to ctrl+s.
314544
- Mousetrap.bindGlobal('mod+s', function(e) {
314545
- CPO.save();
314546
- e.stopImmediatePropagation();
314547
- e.preventDefault();
314548
- });
314544
+ // Saving has a special condition: when embedded we want the Ctrl-S to
314545
+ // propagate up. We could fire a special “save” event, but for contexts
314546
+ // like VScode it is nice to have the “real” Cmd-S event fire to get
314547
+ // good default behavior
314548
+ if(!PYRET_IS_EMBEDDED) {
314549
+ Mousetrap.bindGlobal('mod+s', function(e) {
314550
+ CPO.save();
314551
+ e.stopImmediatePropagation();
314552
+ e.preventDefault();
314553
+ });
314554
+ }
314549
314555
 
314550
314556
  // resize, Toggle sizing of the editor window between 50% and last resize
314551
314557
  Mousetrap.bindGlobal('ctrl+m', function(e){
@@ -314541,11 +314541,17 @@ ${labelRow}`;
314541
314541
 
314542
314542
  // save
314543
314543
  // On Mac mod ends up mapping to command+s whereas on Windows and Linux it maps to ctrl+s.
314544
- Mousetrap.bindGlobal('mod+s', function(e) {
314545
- CPO.save();
314546
- e.stopImmediatePropagation();
314547
- e.preventDefault();
314548
- });
314544
+ // Saving has a special condition: when embedded we want the Ctrl-S to
314545
+ // propagate up. We could fire a special “save” event, but for contexts
314546
+ // like VScode it is nice to have the “real” Cmd-S event fire to get
314547
+ // good default behavior
314548
+ if(!PYRET_IS_EMBEDDED) {
314549
+ Mousetrap.bindGlobal('mod+s', function(e) {
314550
+ CPO.save();
314551
+ e.stopImmediatePropagation();
314552
+ e.preventDefault();
314553
+ });
314554
+ }
314549
314555
 
314550
314556
  // resize, Toggle sizing of the editor window between 50% and last resize
314551
314557
  Mousetrap.bindGlobal('ctrl+m', function(e){