diff --git a/edit/edit.css b/edit/edit.css index 60de98dd..2ceddfe5 100644 --- a/edit/edit.css +++ b/edit/edit.css @@ -926,8 +926,7 @@ body.linter-disabled .hidden-unless-compact { /************ line widget *************/ .CodeMirror-linewidget .applies-to { margin: 1em 0; - padding: .75rem .75rem .25rem; - padding-right: calc(1em + 20px); + padding: .75rem calc(.25rem + var(--cm-bar-width, 0)) .25rem .75rem; } .CodeMirror-linewidget .applies-to li { diff --git a/edit/moz-section-widget.js b/edit/moz-section-widget.js index e1f79a12..60d95f18 100644 --- a/edit/moz-section-widget.js +++ b/edit/moz-section-widget.js @@ -286,6 +286,13 @@ function MozSectionWidget(cm, finder = MozSectionFinder(cm)) { above: true, height, }); + widget.on('redraw', () => { + const value = cm.display.barWidth + 'px'; + if (widget[KEY] !== value) { + widget[KEY] = value; + node.style.setProperty('--cm-bar-width', value); + } + }); } if (!funcHeight) { funcHeight = node.offsetHeight / (sec.funcs.length || 1);