fix: handle undefined disposables
This commit is contained in:
parent
1374574f30
commit
9924e868e0
1 changed files with 4 additions and 11 deletions
|
|
@ -45,7 +45,9 @@ export class JumpManager {
|
|||
|
||||
public dispose() {
|
||||
// Dispose current decoration.
|
||||
this._disposables.forEach((d) => d.dispose());
|
||||
this._disposables.forEach((d) => {
|
||||
if (d) d.dispose();
|
||||
});
|
||||
this._disposables = [];
|
||||
}
|
||||
|
||||
|
|
@ -75,14 +77,6 @@ export class JumpManager {
|
|||
document.lineCount - 1,
|
||||
);
|
||||
|
||||
console.log(
|
||||
"editor lines:",
|
||||
document
|
||||
.getText()
|
||||
.split("\n")
|
||||
.slice(startLine, endLine + 1),
|
||||
);
|
||||
|
||||
// First check if we have enough lines in the document
|
||||
if (endLine - startLine + 1 < completionLines.length) {
|
||||
// Not enough lines in document, so content can't be identical.
|
||||
|
|
@ -225,8 +219,7 @@ export class JumpManager {
|
|||
}
|
||||
|
||||
// Dispose any active listeners.
|
||||
this._disposables.forEach((d) => d.dispose());
|
||||
this._disposables = [];
|
||||
this.dispose();
|
||||
|
||||
// Reset the context.
|
||||
await vscode.commands.executeCommand(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue