Skip to content
This repository was archived by the owner on Aug 23, 2020. It is now read-only.
This repository was archived by the owner on Aug 23, 2020. It is now read-only.

How to configure the mode option of a CodeMirror widget for C++? #24

@GoBigorGoHome

Description

@GoBigorGoHome

As the language modes page shows, for the C++ language CodeMirror only has a C-like mode, and it seems that to make a proper configuration for C++, we have to

  1. set the name of the mode to 'clike' to load the appropriate mode file (clike.js in this case), and
  2. set the MIME type to text/x-c++src, as suggested at the bottom of this page, since the clike mode is not C++-specific.

And how can I achieve that without hard-coding something into the template file?

For reference, the CodeMirror manual says

mode: string|object
The mode to use. It may be a string, which either simply names the mode or is a MIME type associated with the mode. Alternatively, it may be an object containing configuration options for the mode, with a name property that names the mode (for example {name: "javascript", json: true})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions