Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'editor.action.moveLinesDownAction': cmd => {
cmd._kbOpts.primary = cmd._kbOpts.linux.primary = monaco.KeyMod.WinCtrl | monaco.KeyMod.Alt | monaco.KeyCode.DownArrow;
cmd._kbOpts.mac = {};
cmd._kbOpts.mac.primary = monaco.KeyMod.CtrlCmd | monaco.KeyMod.WinCtrl | monaco.KeyCode.DownArrow;
},
'editor.action.moveLinesUpAction': cmd => {
cmd._kbOpts.primary = cmd._kbOpts.linux.primary = monaco.KeyMod.WinCtrl | monaco.KeyMod.Alt | monaco.KeyCode.UpArrow;
cmd._kbOpts.mac = {};
cmd._kbOpts.mac.primary = monaco.KeyMod.CtrlCmd | monaco.KeyMod.WinCtrl | monaco.KeyCode.UpArrow;
}
wrappingIndent: 'same'
} as monaco.editor.IEditorOptions,
modelOptions: {
insertSpaces: true,
tabSize: 2,
trimAutoWhitespace: true
} as monaco.editor.ITextModelUpdateOptions,
keybindings: {
'cursorTop': {
options: {
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: monaco.KeyMod.CtrlCmd | monaco.KeyCode.Home,
mac: { primary: monaco.KeyMod.CtrlCmd | monaco.KeyCode.UpArrow },
weight: 0
}
},
handler ( accessor, editor: MonacoEditor ) {
const position0 = {
lineNumber: 0,
column: 0
};
editor.restoreViewState ({
contributionsState: {},
cursorState: [{
inSelectionMode: false,
selectionStart: position0,
position: position0
}],
this.editor = monaco.editor.create(this.editorContainerTarget, {
value: "puts \"Hello from #{RUBY_ENGINE} #{RUBY_VERSION} 👋\"",
language: 'ruby',
minimap: {
enabled: false
},
automaticLayout: true,
fontSize: '16px',
scrollBeyondLastLine: false,
hideCursorInOverviewRuler: true,
renderLineHighlight: 'none',
renderLineHighlightOnlyWhenFocus: false,
overviewRulerBorder: false,
})
this.editor.addCommand(monaco.KeyMod.chord(monaco.KeyMod.CtrlCmd | monaco.KeyCode.Enter), () => {
this.execute()
})
}
kbExpr: EditorContextKeys.editorTextFocus,
primary: monaco.KeyMod.Alt | monaco.KeyCode.Enter,
weight: 100
}
},
handler ( accessor, editor: MonacoEditor ) {
Todo.toggleTodo ( editor );
}
},
'editor.toggleTodoDone': {
options: {
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: monaco.KeyMod.Alt | monaco.KeyCode.KEY_D,
weight: 100
}
},
handler ( accessor, editor: MonacoEditor ) {
Todo.toggleTodoDone ( editor );
}
}
} as { [command: string]: { options: any, handler: Function } | undefined },
keybindingsPatched: {
'actions.find': false,
'actions.findWithSelection': false,
'cancelSelection': false,
'closeFindWidget': false,
} as monaco.editor.IEditorOptions,
modelOptions: {
insertSpaces: true,
tabSize: 2,
trimAutoWhitespace: true
} as monaco.editor.ITextModelUpdateOptions,
keybindings: {
'cursorTop': {
options: {
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: monaco.KeyMod.CtrlCmd | monaco.KeyCode.Home,
mac: { primary: monaco.KeyMod.CtrlCmd | monaco.KeyCode.UpArrow },
weight: 0
}
},
handler ( accessor, editor: MonacoEditor ) {
const position0 = {
lineNumber: 0,
column: 0
};
editor.restoreViewState ({
contributionsState: {},
cursorState: [{
inSelectionMode: false,
selectionStart: position0,
position: position0
}],
viewState: {