Skip to content

Commit 62ca3f6

Browse files
author
Ives van Hoorne
committed
Temporarily fix saving in Monaco after CMD+V
1 parent 3593352 commit 62ca3f6

File tree

1 file changed

+12
-0
lines changed
  • packages/app/src/app/components/CodeEditor/Monaco

1 file changed

+12
-0
lines changed

packages/app/src/app/components/CodeEditor/Monaco/index.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,18 @@ class MonacoEditor extends React.Component<Props, State> implements Editor {
327327
if (this.props.onInitialized) {
328328
this.disposeInitializer = this.props.onInitialized(this);
329329
}
330+
331+
// TODO remove this as soon as we solve the keybinding issues
332+
editor.addCommand(
333+
// eslint-disable-next-line
334+
this.monaco.KeyMod.CtrlCmd | this.monaco.KeyCode.KEY_S,
335+
() => {
336+
const { onSave } = this.props;
337+
if (onSave) {
338+
onSave(this.getCode());
339+
}
340+
}
341+
);
330342
};
331343

332344
setCompilerOptions = () => {

0 commit comments

Comments
 (0)