fix: restore CM6 editor visual consistency#4144#4147
Merged
khanniie merged 2 commits intoJun 3, 2026
Merged
Conversation
khanniie
approved these changes
Jun 3, 2026
Member
khanniie
left a comment
There was a problem hiding this comment.
Looks super good! Appreciate the fix and fast turnaround!
|
|
||
| .cm-foldGutter .cm-gutterElement { | ||
| cursor: pointer; | ||
| // !important needed to override CM6's inline display style on gutter elements |
Member
There was a problem hiding this comment.
let's avoid using !important if possible. I think if you add enough specificity to the CSS it should be possible override it naturally
Contributor
Author
There was a problem hiding this comment.
Done, removed the !important flags
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue:
Fixes #4144
The CM6 branch had three visual inconsistencies compared to the current CM5 editor: temporary layout compression during font-size changes, missing fold gutter styling, and the fold collapsed placeholder not matching CM5's appearance.
Demo:
Befor :
Screen.Recording.2026-06-03.at.5.24.43.PM.mov
After :
Screen.Recording.2026-06-03.at.5.27.13.PM.mov
Changes:
stateUtils.js— AddedfontSizeCptCompartment usingEditorView.theme()so font-size changes go through CM6's state system instead of direct DOM manipulation, preventing layout compression. AddedcreateFoldMarkerusing the officialfoldGutter({ markerDOM })API to render fold arrows using the same SVG icons as CM5 (codefold-icon-open/codefold-icon-closed). Usedwindow.documentexplicitly to avoid shadowing by thedocumentparameter increateNewFileState.codemirror.js— WiredfontSizeCptreconfigure on font-size preference change, following the same Compartment pattern aslineNumbersCpt,lineWrappingCptetc._editor.scss— Added fold gutter styles translated from CM5 (.CodeMirror-foldgutter-*→.cm-foldGutter,.cm-fold-open,.cm-fold-closed) and fold placeholder styles (.CodeMirror-foldmarker→.cm-foldPlaceholder) using the same theme variables.I have verified that this pull request:
npm run lint)npm run test)npm run typecheck)developbranch.Fixes #4144