fix mozdoc widget when duplicating section
This commit is contained in:
parent
dff0c133b4
commit
f7bbfd6ead
|
@ -276,13 +276,14 @@ function MozSectionWidget(cm, finder = MozSectionFinder(cm)) {
|
||||||
let widget = old && old.widget;
|
let widget = old && old.widget;
|
||||||
const height = Math.round(funcHeight * (sec.funcs.length || 1)) || undefined;
|
const height = Math.round(funcHeight * (sec.funcs.length || 1)) || undefined;
|
||||||
const node = renderContainer(sec, widget);
|
const node = renderContainer(sec, widget);
|
||||||
if (widget) {
|
if (widget && widget.line.lineNo() === sec.start.line) {
|
||||||
widget.node = node;
|
widget.node = node;
|
||||||
if (height && height !== widget.height) {
|
if (height && height !== widget.height) {
|
||||||
widget.height = height;
|
widget.height = height;
|
||||||
widget.changed();
|
widget.changed();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (widget) widget.clear();
|
||||||
widget = cm.addLineWidget(sec.start.line, node, {
|
widget = cm.addLineWidget(sec.start.line, node, {
|
||||||
coverGutter: true,
|
coverGutter: true,
|
||||||
noHScroll: true,
|
noHScroll: true,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user