How to use the monaco-editor/esm/vs/editor/editor.api.js.KeyCode function in monaco-editor

To help you get started, we’ve selected a few monaco-editor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github notable / notable / src / renderer / utils / monaco.ts View on Github external
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: {
github notable / notable / src / renderer / utils / monaco.ts View on Github external
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
        }
github notable / notable / src / renderer / utils / monaco.ts View on Github external
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 );

      }
    },
github notable / notable / src / renderer / utils / monaco.ts View on Github external
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: {