File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 55 import { type TreeNode } from " $lib/components/tree/index.svelte" ;
66 import { on } from " svelte/events" ;
77 import { type Attachment } from " svelte/attachments" ;
8+ import { boolAttr } from " runed" ;
89
910 const viewer = MultiFileDiffViewerState .get ();
1011
7677 <div class =" h-100" >
7778 {#snippet fileSnippet (value : FileDetails )}
7879 <div
79- class =" flex cursor-pointer items-center justify-between btn-ghost px-2 py-1 text-sm focus:ring-2 focus:ring-primary focus:outline-none focus:ring-inset"
80+ class =" file flex cursor-pointer items-center justify-between btn-ghost px-2 py-1 text-sm focus:ring-2 focus:ring-primary focus:outline-none focus:ring-inset"
8081 onclick ={(e ) => scrollToFileClick (e , value .index )}
8182 {@attach focusFileDoubleClick (value )}
8283 onkeydown ={(e ) => e .key === " Enter" && viewer .scrollToFile (value .index )}
8384 role =" button"
8485 tabindex =" 0"
8586 id ={" file-tree-file-" + value .index }
87+ data-selected ={boolAttr (viewer .selection ?.file .index === value .index )}
8688 >
8789 <span
8890 class =" {getFileStatusProps (value .status ).iconClasses } me-1 flex size-4 shrink-0 items-center justify-center"
152154 background-color : var (--color-gray-500 );
153155 display : block ;
154156 }
157+ .file [data-selected ] {
158+ position : relative ;
159+ &::after {
160+ content : " " ;
161+ position : absolute ;
162+ top : 0 ;
163+ left : 0 ;
164+ width : 100% ;
165+ height : 100% ;
166+ box-shadow : inset 4px 0 0 0 var (--color-primary );
167+ }
168+ }
155169 </style >
You can’t perform that action at this time.
0 commit comments