I’m experiencing an issue with CodeMirror v6 when using Java. When I write code and press Enter to move to a new line, all characters in the new line are highlighted as if they are keywords, which shouldn’t happen.
This issue is also reproducible in the CodeMirror v6 Demo.
Reproduction Steps:
Write anything that is not a Java keyword.
Press Enter.
Write anything that is not a Java keyword in the new line.
Repeat steps 1, 2, and 3—you will notice that all characters in the new line are incorrectly highlighted as keywords.
I cannot reproduce this. I’m seeing the first three words in the input highlighted as type, variable definition, and expression. None of them are keywords (purple in the default coloring).
If you’re not inputting valid Java code, the parser is going to try to make something that resembles a Java program out of it, and the result you’re getting doesn’t seem unreasonable.