CodeMirror javascript Gutter line Number padding

I have a script here -> http://jsfiddle.net/bagofmilk/HfDbe/5/

I am trying to allow users to change the font size of the editor. The problem is that the flax thread in the shear of the gutter in the gutter, and sometimes outside the gutter. If you set the font size to 10px, you will see that the line layers are not correctly aligned in the gutter.

I cannot figure out which class I need to configure. I thought this:

$('.CodeMirror-sizer').css('width', linenumbers); 

But it does not work

Basically, I'm looking for line numbers to fit correctly into the gutter every time I change the font size.

+4
source share
1 answer

Call .refresh() after changing the style that will affect the editor layout. This should make everything correctly paid.

+6
source

Source: https://habr.com/ru/post/1502937/


All Articles