This commit is contained in:
Henning Dieterichs 2024-03-26 19:42:28 +01:00 committed by Henning Dieterichs
parent 17e86debf7
commit 3e41bfbe49

View file

@ -118,10 +118,12 @@ export class EditorGutter<T extends IGutterItemInfo = IGutterItemInfo> extends D
gutterItem.range.startLineNumber <= this._editor.getModel()!.getLineCount()
? this._editor.getTopForLineNumber(gutterItem.range.startLineNumber, true) - scrollTop
: this._editor.getBottomForLineNumber(gutterItem.range.startLineNumber - 1, false) - scrollTop;
const bottom = this._editor.getBottomForLineNumber(gutterItem.range.endLineNumberExclusive - 1, true) - scrollTop;
const bottom = gutterItem.range.isEmpty
// Don't trust that `getBottomForLineNumber` for the previous line equals `getTopForLineNumber` for the current one.
? top
: (this._editor.getBottomForLineNumber(gutterItem.range.endLineNumberExclusive - 1, true) - scrollTop);
const height = bottom - top;
view.domNode.style.top = `${top}px`;
view.domNode.style.height = `${height}px`;