Gutters not aligning correctly

Hi,

Not sure if it’s a bug or if we just missed some custom styling but for some reason, the gutters class doesn’t align properly with the editor container.

When we first open the editor:

When we close the editor and then reopen it:

The line number and the line-text seem to have different paddings applied to it.
A complete front-end rookie here so pardon me if this seems ignorant, but is that styling somehow a problem from the css provided by code-mirror?

What the gutter looks like when buggy:

What the gutter looks like when working fine (editor opened for the first time):

As you can see from the images above, the gutter hugs the left when it’s working fine, but then it somehow has a gap when reopened. I’ve checked the padding and there’s no padding whatsoever added - not sure why.

Does calling .refresh() on the editor fix the gutter position? If so, arrange for that to be called whenever you make the editor visible.

1 Like

Hi,

Calling .refresh() seemed to fix it. Thanks for the help!