-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Replace Ace Editor with CodeMirror #4933
Conversation
3112703
to
2e7be1f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for replacing the legacy editor!
|
||
// A custom theme for CodeMirror that applies the same CSS as Rouge does, | ||
// meaning we can use our existing themes. | ||
const rougeStyle = HighlightStyle.define([ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this also be used for the papyros code editor? (as it also uses code mirror)
This would greatly improve styling
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since Papyros sets up its own editor, this is no small task: we would need to either hardcode a "dodona" mode (which isn't nice) or change the API to support configuring the CodeMirror instance used by Papyros (which is a lot of work).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we make the 'dodona mode' the default for papyros? ANd just make their default styling consistent.
I'll have a look at this at some later point. No need to fix that for this pr
CodeMirror uses the .nv class a lot, meaning a lot of the code will be italicized. Rather than change CodeMirror to use the less specific and less semantic class .n (for names), we remove the italic from the .nv class instead.
2e7be1f
to
2e4cd2b
Compare
This pull request replaces the Ace Editor with CodeMirror (which is a commonly-used text editing component for the web).
While functionally equivalent for end-users, it does have some benefits:
On the other hand, it does need a bit more code to:
Closes #4585 as a side effect.