Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
position: position0
}],
viewState: {
scrollLeft: 0,
firstPosition: position0,
firstPositionDeltaTop: Infinity // Ensuring we are scrolling to the very top, important in zen mode
}
});
}
},
'editor.toggleLineNumbers': {
options: {
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: monaco.KeyMod.Alt | monaco.KeyCode.KEY_L,
weight: 100
}
},
handler ( accessor, editor: MonacoEditor ) {
Monaco.editorOptions.lineNumbers = ( Monaco.editorOptions.lineNumbers === 'off' ) ? 'on' : 'off';
Settings.set ( 'monaco.editorOptions.lineNumbers', Monaco.editorOptions.lineNumbers );
editor.updateOptions ( Monaco.editorOptions );
}
},
'editor.toggleMinimap': {
options: {
Monaco.editorOptions.wordWrap = Monaco.editorOptions.wordWrap === 'bounded' ? 'off' : 'bounded';
Settings.set ( 'monaco.editorOptions.wordWrap', Monaco.editorOptions.wordWrap );
editor.updateOptions ( Monaco.editorOptions );
}
},
'editor.toggleTodo': {
options: {
precondition: EditorContextKeys.writable,
kbOpts: {
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 ) {
Monaco.editorOptions.lineNumbers = ( Monaco.editorOptions.lineNumbers === 'off' ) ? 'on' : 'off';
Settings.set ( 'monaco.editorOptions.lineNumbers', Monaco.editorOptions.lineNumbers );
editor.updateOptions ( Monaco.editorOptions );
}
},
'editor.toggleMinimap': {
options: {
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: monaco.KeyMod.Alt | monaco.KeyCode.KEY_M,
weight: 100
}
},
handler ( accessor, editor: MonacoEditor ) {
if ( !Monaco.editorOptions.minimap ) Monaco.editorOptions.minimap = {};
Monaco.editorOptions.minimap.enabled = !Monaco.editorOptions.minimap.enabled;
Settings.set ( 'monaco.editorOptions.minimap.enabled', Monaco.editorOptions.minimap.enabled );
editor.updateOptions ( Monaco.editorOptions );
}
},
Monaco.editorOptions.minimap.enabled = !Monaco.editorOptions.minimap.enabled;
Settings.set ( 'monaco.editorOptions.minimap.enabled', Monaco.editorOptions.minimap.enabled );
editor.updateOptions ( Monaco.editorOptions );
}
},
'editor.toggleWordWrap': {
options: {
precondition: EditorContextKeys.writable,
kbOpts: {
kbExpr: EditorContextKeys.editorTextFocus,
primary: monaco.KeyMod.Alt | monaco.KeyCode.KEY_Z,
weight: 100
}
},
handler ( accessor, editor: MonacoEditor ) {
Monaco.editorOptions.wordWrap = Monaco.editorOptions.wordWrap === 'bounded' ? 'off' : 'bounded';
Settings.set ( 'monaco.editorOptions.wordWrap', Monaco.editorOptions.wordWrap );
editor.updateOptions ( Monaco.editorOptions );
}
},
'editor.toggleTodo': {
options: {