-
Notifications
You must be signed in to change notification settings - Fork 7.6k
CodeMirror calculates incorrectly the min-height when the font size is not the default one #3115
Comments
@TomMalbran -- could you take a stab at reproducing this in standalone CodeMirror (outside of Brackets)? I think the only thing CM is supposed to require after changing the font size is a |
Also, could you characterize how bad the user-visible aspects of the bug are? If it's just that the cursor doesn't always end up visible after a page down, that's not terrible. But if you can't scroll to see the whole document, for example, that would be pretty bad. |
I tested in a standalone CodeMirror and understood what is the problem: This is what I did:
|
It looks like the codemirror/codemirror5#2157 may have fixed this a couple months back. @TomMalbran are you still seeing this? Comments in #7093 would imply you still are..? |
I haven't checked it in the code, but there is still something wrong. Open a file with over 300 lines and place the scroll at the top, increase the font size a bit and then scroll fast to the end of the file. You should see some issues with the scroll thumb which gets smaller as it reaches the end of the file. |
It does seem to be fixed. I was testing in Sprint 36 before and not in master. I will test a bit more and close if it is fixed. |
Cool, closing as fixed. Will submit a PR soon to remove the hack done to avoid this bug. |
While doing #3068 i noticed that every line not rendered (not in the dom) was calculated always using the default font size (15px) even when adjusting the font size. You can test this in different ways:
EditorManager.getCurrentFullEditor()._codeMirror.getLineHandle(0).height
when the scroll is not at the top..CodeMirror-lines
with:And the first rendered line with
EditorManager.getCurrentFullEditor()._codeMirror.getViewport().from
and then divide the top with the lines.This is causing some the next visible problems:
ViewCommandHandlers
.Open src/thirdparty/CodeMirror2/lib/codemirror.js
The text was updated successfully, but these errors were encountered: