Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Fix over-repaint issue when typing #3767

Merged
merged 3 commits into from
May 10, 2013
Merged

Fix over-repaint issue when typing #3767

merged 3 commits into from
May 10, 2013

Conversation

jasonsanjose
Copy link
Member

Somehow, removing the default 1px border-right from CodeMirror-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.

@njx
Copy link

njx commented May 9, 2013

What the.

@njx
Copy link

njx commented May 9, 2013

image

@njx
Copy link

njx commented May 9, 2013

Why was the min-width change necessary?

@jasonsanjose
Copy link
Member Author

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.

@ghost ghost assigned redmunds May 9, 2013
}
.CodeMirror-linenumber {
color: @accent-comment;
min-width: 2.5em;
min-width: 30px;
Copy link
Contributor

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.

Copy link
Member Author

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.

@redmunds
Copy link
Contributor

redmunds commented May 9, 2013

Done with review.

@jasonsanjose
Copy link
Member Author

@redmunds ready for review

@redmunds
Copy link
Contributor

Merging.

redmunds added a commit that referenced this pull request May 10, 2013
Fix over-repaint issue when typing
@redmunds redmunds merged commit 03d0c07 into master May 10, 2013
@redmunds redmunds deleted the jasonsanjose/perf branch May 10, 2013 18:02
@jasonsanjose
Copy link
Member Author

@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).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants