File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 11import type { TreeViewNode } from 'reactive-vscode'
2- import { createSingletonComposable , ref } from 'reactive-vscode'
2+ import { createSingletonComposable } from 'reactive-vscode'
3+
34import { FileNode } from './entity/FileNode'
45import { FolderNode } from './entity/FolderNode'
6+
57import { type CommitFile , useGitService } from '@/git'
68import { parseGitStatus } from '@/utils'
9+ import { GIT_STATUS } from '@/constant'
710
811export const useFileTreeView = createSingletonComposable ( ( ) => {
912 const git = useGitService ( )
@@ -111,7 +114,7 @@ export const useFileTreeView = createSingletonComposable(() => {
111114 const [ status , ...pathParts ] = line . split ( '\t' )
112115 const { type, similarity } = parseGitStatus ( status )
113116
114- if ( type === 'R' && pathParts . length === 2 ) {
117+ if ( type === GIT_STATUS . RENAMED && pathParts . length === 2 ) {
115118 const [ oldPath , newPath ] = pathParts
116119 return {
117120 status : type ,
Original file line number Diff line number Diff line change @@ -8,9 +8,6 @@ export class FileNode extends TreeItem {
88 public readonly commitHash : string ,
99 public readonly oldPath ?: string ,
1010 ) {
11- const label = path . split ( '/' ) . pop ( ) || path
12- super ( label , TreeItemCollapsibleState . None )
13-
1411 // 为重命名的文件创建特殊的 URI
1512 const params = new URLSearchParams ( )
1613 params . set ( 'status' , status )
@@ -19,7 +16,7 @@ export class FileNode extends TreeItem {
1916 }
2017
2118 const uri = Uri . parse ( `${ EXTENSION_SYMBOL } :${ path } ?${ params . toString ( ) } ` )
22- this . resourceUri = uri
19+ super ( uri , TreeItemCollapsibleState . None )
2320
2421 this . tooltip = oldPath
2522 ? `${ status } ${ oldPath } → ${ path } `
Original file line number Diff line number Diff line change @@ -347,7 +347,7 @@ const hasActiveFilter = computed(() => {
347347
348348.branch-select ,
349349.author-select {
350- min -width : 120 px ;
350+ max -width : 180 px ;
351351 padding : 4px 8px ;
352352 border : 1px solid var (--vscode-input-border );
353353 background-color : var (--vscode-input-background );
You can’t perform that action at this time.
0 commit comments