File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 11591159 const items = document . querySelectorAll ( '.tree-item' ) ;
11601160 let matches = 0 ;
11611161 const total = items . length ;
1162+
11621163 items . forEach ( item => {
11631164 const nameEl = item . querySelector ( '.file-name' ) ;
11641165 const name = nameEl ? nameEl . textContent . toLowerCase ( ) : '' ;
1165- const path = ( item . dataset . path || '' ) . toLowerCase ( ) ;
1166- const match = ! term || name . includes ( term ) || path . includes ( term ) ;
1166+
1167+ // Only search by name, support partial matching
1168+ const match = ! term || name . includes ( term ) ;
1169+
11671170 item . style . display = match ? '' : 'none' ;
11681171 item . classList . toggle ( 'search-match' , ! ! term && match ) ;
1172+
11691173 if ( term && match ) {
11701174 matches += 1 ;
11711175 openTreeParents ( item ) ;
11721176 }
11731177 } ) ;
1178+
11741179 if ( D . searchMeta ) {
11751180 D . searchMeta . textContent = term
11761181 ? `${ matches } match${ matches === 1 ? '' : 'es' } of ${ total } `
1177- : 'Search file and folder names (case-insensitive )' ;
1182+ : 'Search by file or folder name (partial match supported )' ;
11781183 }
11791184 if ( D . searchClear ) {
11801185 D . searchClear . hidden = ! term ;
You can’t perform that action at this time.
0 commit comments