[Phpmyadmin-devel] Codemirror upgrade broke my features

Rouslan Placella rouslan at placella.com
Fri Aug 19 16:51:42 CEST 2011

On Fri, 2011-08-19 at 17:41 +0300, Tyron Madlener wrote:
> On Fri, Aug 19, 2011 at 5:35 PM, Rouslan Placella <rouslan at placella.com> wrote:
> > Yesterday Tyron brought to my attention that the editors for Routines,
> > Triggers and Events look quite bad now. I've tracked the issue down to
> > the upgrade of codemirror to version 2.12 (before/after screenshot
> > attached). And in particular these lines of code that were introduced in
> > codemirror.js (lines 775-777):
> >
> > --->%---
> > // Needed to prevent odd wrapping/hiding of widgets placed in here.
> > code.style.width = "";
> > code.style.width = scroller.scrollWidth + "px";
> > --->%---
> >
> > I'd like to comment these lines out, since I don't think that there is
> > any other way of fixing the issue. Any objections?
> >
> > Rouslan
> Oh, that is awesome that you found the bug. I've had the same issues
> on my code before.

Well, that's half the story, actually. I have a small hack that is
called right after codemirror is loaded to ensure that it doesn't expand
beyond where it's supposed to:

// Hack to prevent the codemirror from expanding beyond dialog boundries
$('.CodeMirror-scroll').find('div').first().css('width', '1px');

> Do you know what the code snippet does actually? Maybe we should ask
> the original author first what it's for.

No idea, actually, I tried to git-blame codemirror's GIT repo to figure
out when that code was introduced, but I didn't manage. I guess I didn't
try hard enough. So, yeah, maybe it's a good idea to email codemirror's
author. I'll do that later.


More information about the Developers mailing list