Removes unneeded additionalReservedLineCount from GhostText

This commit is contained in:
Henning Dieterichs 2023-04-20 12:18:14 +02:00
parent dbf4b14dfa
commit 239849f575
No known key found for this signature in database
GPG key ID: 771381EFFDB9EC06
4 changed files with 3 additions and 4 deletions

View file

@ -10,7 +10,6 @@ export class GhostText {
constructor(
public readonly lineNumber: number,
public readonly parts: GhostTextPart[],
public readonly additionalReservedLineCount: number = 0
) {
}

View file

@ -119,7 +119,7 @@ export class GhostTextWidget extends Disposable {
additionalLines,
hiddenRange,
lineNumber: ghostText.lineNumber,
additionalReservedLineCount: ghostText.additionalReservedLineCount,
additionalReservedLineCount: this.model.minReservedLineCount.read(reader),
targetTextModel: textModel,
};
});

View file

@ -187,7 +187,7 @@ export class InlineCompletionsModel extends Disposable {
const newGhostText = edit.computeGhostText(model, mode, cursor, editPreviewLength);
// Show an invisible ghost text to reserve space
return newGhostText ?? new GhostText(edit.range.endLineNumber, [], 0);
return newGhostText ?? new GhostText(edit.range.endLineNumber, []);
} else {
if (!this._isActive.read(reader)) { return undefined; }
const item = this.selectedInlineCompletion.read(reader);

View file

@ -140,7 +140,7 @@ export class SingleTextEdit {
}
}
return new GhostText(lineNumber, parts, 0);
return new GhostText(lineNumber, parts);
}
}