-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Desktop: Improve beta editor support for the Rich Markdown plugin #9935
Desktop: Improve beta editor support for the Rich Markdown plugin #9935
Conversation
@personalizedrefrigerator, there's just one conflict and then we can merge |
@@ -10,6 +10,8 @@ import { ViewPlugin, DecorationSet, ViewUpdate } from '@codemirror/view'; | |||
import { ensureSyntaxTree } from '@codemirror/language'; | |||
import { RangeSetBuilder } from '@codemirror/state'; | |||
|
|||
const baseLineDecoration = Decoration.line({ class: 'CodeMirror-line' }); |
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.
- <div class="cm-line">...</div>
+ <div class="cm-line CodeMirror-line">...</div>
- Check which plugins need this.
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.
I've removed the CodeMirror-line
class — RichMarkdown only needs it in 1-2 places.
Other plugins like ReMoods seem to use it, but also rely on other CSS classes being present that we don't seem to have.
'&.CodeMirror': { | ||
height: 'unset', | ||
background: 'unset', | ||
overflow: 'unset', | ||
direction: 'unset', | ||
}, |
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.
Adding the .CodeMirror
class to the editor makes it easier to migrate styles originally intended for CodeMirror 5. It does, however, mean that several CodeMirror 5 styles need to be overridden.
Here as well, some more conflicts |
Summary
This pull request builds on the changes to the CodeMirror 5 emulation in #9928 to make more features of the Rich Markdown plugin work in the CodeMirror 6 beta editor.
Note
This pull request currently includes all changes from #9928.
It also requires this Rich Markdown pull request to be merged.
Specifically, it,
CodeMirror
class to the CodeMirror 6 editor. This allows existing Rich Markdown stylesheets to be applied to the editor..CodeMirror
elements, this pull request adjusts several existing styles.styleActiveLine
CodeMirror 5 optioneditor.addWidget
editor.markText
(originally from Desktop: Resolves #9927: Beta editor: Fix search results not highlighted #9928)defineExtension
doesn't override existing extensions with the same namecoordsChar
handles thepage
modeCodeMirror-line
class to visible lines in the editorThis pull request still requires changes to the Rich Markdown plugin. A pull request will be opened shortly.
Testing
Regression testing (desktop):
This has been successfully tested on Ubuntu 23.10.
Regression testing (mobile):
This has been tested successfully on Android 7.