feat: render jump suggestion at the location of the next decoration when the decoration should be rendered inside the viewport

This commit is contained in:
Jacob Kim 2025-07-18 12:33:20 -07:00
parent ae36095a89
commit deae3c66d3

View file

@ -60,7 +60,12 @@ export class JumpManager {
);
} else {
// No suggestion is made when the decoration is within visibleRange.
return;
await this.renderTabToJumpDecoration(
editor,
decorationLine,
nextJumpLocation,
);
// return;
}
// Scroll to show the jump location.
@ -92,8 +97,14 @@ export class JumpManager {
});
// Apply the decoration.
const lastIndexOfLine = editor.document.lineAt(lineToRenderOn).text.length;
editor.setDecorations(this._jumpDecoration, [
new vscode.Range(lineToRenderOn, 0, lineToRenderOn, 0),
new vscode.Range(
lineToRenderOn,
lastIndexOfLine,
lineToRenderOn,
lastIndexOfLine,
),
]);
// Set the context key to enable tab/esc shortcuts.