✨ feat(vscode): 只有从「未提交的更改」点开的预览才对比上一次提交

This commit is contained in:
cruldra committed 2026-10-12 15:52:35 +11:00
1 parent 4ec2b9d5d6
commit 3c7513b7cd
18 files changed
+366 -143

No files matched your search

@@ -26,7 +26,7 @@ class FavoritePane {
constructor(favorite: Favorite, openCommand: string, decorator: FileTreeDecorator) {
this.uri = Uri.parse(favorite.uri)
const files = new FileTreeProvider(openCommand, decorator, { kind: 'directory', uri: this.uri })
const files = new FileTreeProvider({ command: openCommand, from: 'other' }, decorator, { kind: 'directory', uri: this.uri })
this.view = window.createTreeView(slotViewId(favorite.slot), { treeDataProvider: files, showCollapseAll: true })
this.view.title = slotTitle('favorite', favorite.name)
this.view.description = workspace.asRelativePath(this.uri)
@@ -72,7 +72,7 @@ export class FavoriteViews {
/**
* @param state workspaceState
* @param pool 和「了解一块代码」共用的栏位
* @param openCommand 点文件时执行的命令,参数是文件 Uri
* @param openCommand 点文件时执行的命令,参数是文件 Uri 和 `other`(不是从「未提交的更改」点开的)
* @param decorator 给行添信息(文件注释),和别的栏共用
*/
constructor(private readonly state: Memento, private readonly pool: SlotPool, private readonly openCommand: string, private readonly decorator: FileTreeDecorator) {