.refresh() Doesn't update gutter height? #38
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi!
I'm working on an app which will use CodeMirror2 as it's input editor. Everything is working great, except the way the height of the gutter updates. At the moment the height of the gutter gets updated every time a line gets added/removed, which is logical, but it doesn't seem to update when the codemirror instance gets resized.
I thought the best way to counter this, was to call .refresh() on the codemirror object, but it doesn't seem to help. I may be doing something horribly wrong, but it seems to me like .refresh() was created exactly for cases like this.
Looking forward to your reply!
Chiel.
Hi Chiel,
Are you working with the current git HEAD? Commit
ef83a9126cfixed something related to this, and if I now open one of the demo pages, and set (from the script console) the height of the editor, the gutter is indeed off, but calling .refresh() does properly fix this.Best,
Marijn
Hi Marijn,
I made a point to pull in the latest version of CodeMirror2 before "whining" about it here, so yep, I do have that fix.
If .refresh() is supposed to work as I thought, then the only thing I can think of, is the fact that I changed the style of the .CodeMirror class by using height: 100%;, since it's inside of a wrapper, that resizes with the rest of the layout.
This shouldn't really cause any issues as far as I know, but hey, it might be contributing? In what way do you assess the height of the codemirror instance? I made a little hack for this, for now, but it's hardly ideal. Basically every time the window (which means also the editor-wrapper) I set the height of the gutter to "", and the min-height to 100%. That way it's always at least 100% of the codemirror instance, yet it'll still stretch past this.
Best,
Chiel
Someone in the google group provided me with a test case for this.
db0a7e6fa0should solve it. If it doesn't reopen.Awesome, this does the trick perfectly! Thanks a lot for being so fast with all this. CodeMirror is a delight to work with. At the moment it seems to be really slow in Chrome, though. But I'll make another ticket about that if it remains an issue.
Cheers!