-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Conversation
What the. |
Why was the min-width change necessary? |
Filed codemirror/codemirror5#1514. I earlier tried removing min-width to see if that was the cause. It isn't. But I decided to convert this to pixels anyway since we use pixel size fonts. I believe this min-width use of ems here was an oversight. |
} | ||
.CodeMirror-linenumber { | ||
color: @accent-comment; | ||
min-width: 2.5em; | ||
min-width: 30px; |
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.
By using em
for min-width, then the minimum gutter width increases with font size. By changing it to px
, the minimum width is now fixed. You can see this by opening a file with less than 10 lines and increasing font size -- eventually gutter becomes a single char wide. The reverse is that gutter doesn't get smaller when font size decreases. So, I think we want to keep using em
.
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.
Reverted, but filed #3780. I still think we should use padding or min-width as pixels since the primary concern is the spacing around the selection triangle.
Done with review. |
@redmunds ready for review |
Merging. |
Fix over-repaint issue when typing
@marijnh pushed a fix to CodeMirror master codemirror/codemirror5@b2c1d96 to change the gutter height from a 100% height to an explicit height. See comment here codemirror/codemirror5#1514 (comment). |
Somehow, removing the default 1px
border-right
fromCodeMirror-gutters
placeholder caused the repaint issue (where the entire window repaints for each keystroke). As a fix, I've changed the border color to match the gutter background.The problem does reproduce in a boilerplate CodeMirror demo. I'll file a bug.