Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CodeMirror javascript Gutter line Number padding

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

I'm trying to allow users to adjust the font size of the editor. The problem is that the linenumbers in the gutter shift in the gutter and sometimes outside the gutter. If you set the font size to 10px, you will see the linenumbers are not properly aligned in the gutter.

I cannot figure out which class i need to adjust. I thought it was:

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

But that does not seem to work

Basically, I'm looking for the line-numbers to properly fit in the gutter each time the the font size is changed.

like image 756
bagofmilk Avatar asked Sep 19 '13 01:09

bagofmilk


1 Answers

Call .refresh() after changing a style that will influence the layout of the editor. That should make everything reflow properly.

like image 120
Marijn Avatar answered Nov 02 '22 09:11

Marijn