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.

  • Disable JSHint warnings in CodeMirror
  • CodeMirror delete a editor instance
  • How can I act on cursor activity originating from mouse clicks and not keyboard actions?
  • Insert Text at Caret on CodeMirror Textarea
  • CodeMirror 2: Multiple indent is deleting lines
  • Codemirror keymap vim <Esc> not working
  • 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.

  • CodeMirror - Is it possible to scroll to a line so that it is in the middle of window?
  • CodeMirror - language auto-detection
  • CodeMirror . Disabling Vertical scroll bar
  • How to generate Pux actions from a foreign module?
  • CodeMirror does not working with react/webpack
  • Codemirror- linting - Is there a event to trigger linting explictly?
  • One Solution collect form web for “CodeMirror javascript Gutter line Number padding”

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