Open kishimisu opened 1 year ago
@indiana-dev This question, you can go to the official forum to find the answer. https://discuss.codemirror.net/
It really seems to be an issue with react-codemirror, even on the demo page https://uiwjs.github.io/react-codemirror/ if you select for example the "scala" language, you'll see that turning on and off the foldGutter
option doesn't work as expected.
I also tried to set the mode
property inside the options
attribute to the correct MIME type but it doesn't seem to have any effect.
@indiana-dev https://github.com/codemirror/legacy-modes
Is there any workaround on this? I need folding for a yaml editor but I do not find a way to enable it due to the legacy mode.
Is there any workaround on this? I need folding for a yaml editor but I do not find a way to enable it due to the legacy mode.
Me either, I need folding for a yaml editor.. I tried to this, it didn't work.
<CodeViewer extensions={[langs.yaml()]} value={YAML.stringify(data)} editable={false} readOnly={true} basicSetup={{ foldGutter: true, }} />
Here is a basic component that renders fold gutters fine. You can see that I'm importing the language from
@codemirror/lang-javascript
:However if I try to import it from
@codemirror/legacy-modes/mode/javascript
I can't see any fold gutter :I originally had this issue with the
shader
mode of theclike
legacy-mode language, and unlike javascript I didn't find it elsewhere than in the legacy-mode languages.