feat: Close existing file buffer when opening diff view
wsxiaoys opened this issue · comments
Please describe the feature you want
When displaying the diff view for a pending file (e.g., a.ts), it would be beneficial to automatically close any existing, non-diff editor tabs for a.ts. This would prevent confusion and ensure the user's focus remains on the diff view.
This can be implemented in the openDiffEditor function within packages/vscode/src/integrations/editor/diff-view.ts. Before calling vscode.commands.executeCommand(\"vscode.diff\", ...), we should iterate through the open tabs and close the one corresponding to the file.
Additional context
This feature improves the user experience by reducing clutter and potential confusion when working with diffs.
🤖 Generated with Pochi