Open core-ai-bot opened 3 years ago
Comment by njx Monday Mar 18, 2013 at 18:22 GMT
@
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 refresh()
, but we've noticed when looking at other previous issues that various bits of cached line height state don't all seem to get thrown out on a refresh. If you could reproduce this in CM and file it in the main CM repo, that would be very helpful. Thanks!
Comment by njx Monday Mar 18, 2013 at 18:24 GMT
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.
Comment by TomMalbran Sunday Mar 24, 2013 at 02:06 GMT
I tested in a standalone CodeMirror and understood what is the problem: refresh()
doesn't updates the min-height of the container, so things like PageUp from the bottom of the editor, or sometimes scrolling doesn't work as intended and keep modifying the min-height until it can get to the right size and fix everything.
This is what I did:
codemirror.js
and pasted it in the editor..CodeMirror
div and checked the font size..CodeMirror-sizer
div and checked the min-height..CodeMirror
div and increased the font size to 25px.editor.refresh()
.CodeMirror-sizer
div that the min-height didn't changed.Comment by peterflynn Friday Mar 07, 2014 at 00:48 GMT
It looks like the marijnh/CodeMirror#2157 may have fixed this a couple months back. @
TomMalbran are you still seeing this? Comments in #7093 would imply you still are..?
Comment by TomMalbran Friday Mar 07, 2014 at 00:54 GMT
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.
Comment by TomMalbran Friday Mar 07, 2014 at 01:32 GMT
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.
Comment by TomMalbran Friday Mar 07, 2014 at 02:54 GMT
Cool, closing as fixed. Will submit a PR soon to remove the hack done to avoid this bug.
Issue by TomMalbran Wednesday Mar 13, 2013 at 02:52 GMT Originally opened as https://github.com/adobe/brackets/issues/3115
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