Only remeasure char widths on stylesheet changes if editor is visible

Fixes #2856