Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glitches when adding newlines #6935

Open
jcubic opened this issue Jun 10, 2022 · 5 comments
Open

Glitches when adding newlines #6935

jcubic opened this issue Jun 10, 2022 · 5 comments

Comments

@jcubic
Copy link
Contributor

jcubic commented Jun 10, 2022

I'm not sure if this is because of bugs in PEG.js mode but I have weird results when I'm adding newlines to the editor. Somethings all lines are broken sometimes they are fixed.

PEGJS_mode

This may be because incremental parser and PEG.js have inner JS mode.

Do you think that the problem is in PEG.js mode or in CodeMirror?

@jcubic
Copy link
Contributor Author

jcubic commented Jun 10, 2022

I'm not sure but I don't see only

state.localState = CodeMirror.startState(jsMode);

I don't see anywhere ending the mode in PEG.js (no "}" check anywhere). Maybe that is the problem. But I'm not sure how to turn off the inner mode, there is no endState in CodeMirror.

@jcubic jcubic mentioned this issue Jun 10, 2022
@marijnh
Copy link
Member

marijnh commented Jun 12, 2022

There is no file named PEG.js in the CodeMirror distribution. Is this about pegjs.js, or some 3rd party mode?

@jcubic
Copy link
Contributor Author

jcubic commented Jun 12, 2022

About default pegjs.js mode that is included in the library. The name for the parser generator is PEG.js so I used the name of the project not the filename.

@marijnh
Copy link
Member

marijnh commented Jun 13, 2022

Your PR looks rather unfinished and confused, and this issue doesn't provide a bug description that I can reproduce, so at this point I can't really do much. Also, that mode was contributed and I'm not willing to invest a lot of time into it.

@jcubic
Copy link
Contributor Author

jcubic commented Jun 13, 2022

Yes, the PR is broken, I thought that I've fixed the pegjs mode but I'm not able to make it work the same as htmlmixed. I'm getting stack overflow when trying to get pegjs mode inside pegjs mode. It's really hard because there is no detailed documentation how to write modes. At least I didn't find any.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants