feat: reset edit chain id to null

This commit is contained in:
Jacob Kim 2025-07-15 17:45:18 -07:00
parent 51818bffee
commit 3d0ef7afbc

View file

@ -42,6 +42,7 @@ import { VsCodeIde } from "../VsCodeIde";
import { ConfigYamlDocumentLinkProvider } from "./ConfigYamlDocumentLinkProvider";
import { VsCodeMessenger } from "./VsCodeMessenger";
import { NextEditProvider } from "core/nextEdit/NextEditProvider";
import setupNextEditWindowManager, {
NextEditWindowManager,
} from "../activation/NextEditWindowManager";
@ -368,6 +369,19 @@ export class VsCodeExtension {
}
});
// TODO: check if next edit provider's chain id is cleared properly.
// Listen for editor changes to clean up decorations when editor closes.
vscode.window.onDidChangeVisibleTextEditors(async () => {
// If our active editor is no longer visible, clear decorations.
NextEditProvider.currentEditChainId = null;
});
// Listen for selection changes to hide tooltip when cursor moves.
vscode.window.onDidChangeTextEditorSelection(async (e) => {
// If the selection changed in our active editor, hide the tooltip.
NextEditProvider.currentEditChainId = null;
});
// Refresh index when branch is changed
void this.ide.getWorkspaceDirs().then((dirs) =>
dirs.forEach(async (dir) => {