-
Notifications
You must be signed in to change notification settings - Fork 29
Inherit the editor font in the highlight overlay #204
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -220,6 +220,17 @@ async function checkEditorNewlines(page) { | |
| `${name}: retained after switching languages`, | ||
| ); | ||
| } | ||
|
|
||
| // The overlay paints the glyphs the textarea positions, so a <code> that | ||
| // resolves its own font family drifts away from the caret line by line. | ||
| assert.equal( | ||
| await page | ||
| .locator("#editor-highlight code") | ||
| .evaluate((node) => getComputedStyle(node).fontFamily), | ||
| await editor.evaluate((node) => getComputedStyle(node).fontFamily), | ||
| "editor: highlight font matches the textarea", | ||
| ); | ||
|
|
||
| console.log( | ||
| `editor: ${cases.length} Enter cases passed, including undo, redo and language switching`, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This check has nothing to do with Enter handling, but it sits in |
||
| ); | ||
|
|
||
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.
Following up on my suggestion in #199: I meant the computed font styles as a whole, not only the family. The commit message says the drift came from the taller line box, so
fontSizeandlineHeightbelong in the comparison too; otherwise a laterfont-sizeon<code>brings the drift back with this check still green. For example: