Ks89 / ngx-codemirror6

MIT License
0 stars 0 forks source link

Is this a readonly editor? #1

Open mantasmaciulis opened 9 months ago

mantasmaciulis commented 9 months ago

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[X] Support request

Current behavior

The example in ./src is editable, and I do not see an option to make the component editable.

Expected behavior

I would like to use ngx-codemirror6 as a code editor.

Minimal reproduction of the problem with instructions

Clone this repo, install ngx-codemirror6 and then npm start, try to type something inside the code editor.

What is the motivation / use case for changing the behavior?

I need to use codemirror6 as my editor for a project I am working on as I need to provide my users custom syntax highlighting for a custom language using a lezer grammar, language support.

Environment (the most important section to fill very carefully)


same as dependancies in this repo



Browser:
- [X] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX

Others:

mantasmaciulis commented 9 months ago

const extensions: Extension[] = [lineNumbers(), lang, materialDark, basicSetup, EditorState.readOnly.of(true), ...this.appendExtensions];

This line may be the culprit in ngx-codemirror6/projects/ks89/ngx-codemirror6/src/lib/ngx-codemirror6.component.ts, however I cannot modify this if I npm i ngx-codemirror6

Ks89 commented 9 months ago

Hi, yes I created this repo to use codemirror6 on a personal project, but I didn't invest so much time to add apis and so on. I covered only my use case.

If you are interested, feel free to create a pull request with your proposal. I cannot work on this alone, so all contibutions are welcome.