@@ -31,7 +31,7 @@ const stackExtraSearchStrings = (row: SettingRowStack): string[] => {
3131} ;
3232
3333/** 设置面板内搜索:单条文案是否包含查询串(已 `trim` + `toLowerCase` 的 `queryLower`) */
34- export const textMatchesConfigSearch = ( text : string , queryLower : string ) : boolean => {
34+ export const textMatchesSearch = ( text : string , queryLower : string ) : boolean => {
3535 if ( ! queryLower ) {
3636 return true ;
3737 }
@@ -52,40 +52,40 @@ export const configRowMatchesSearchQuery = (row: SettingRow, queryLower: string)
5252 case "range" :
5353 case "notebookSavePath" :
5454 return (
55- textMatchesConfigSearch ( row . title , queryLower ) ||
56- textMatchesConfigSearch ( row . desc , queryLower )
55+ textMatchesSearch ( row . title , queryLower ) ||
56+ textMatchesSearch ( row . desc , queryLower )
5757 ) ;
5858 case "number" :
5959 if (
60- textMatchesConfigSearch ( row . title , queryLower ) ||
61- textMatchesConfigSearch ( row . desc , queryLower )
60+ textMatchesSearch ( row . title , queryLower ) ||
61+ textMatchesSearch ( row . desc , queryLower )
6262 ) {
6363 return true ;
6464 }
65- if ( row . unit && textMatchesConfigSearch ( row . unit , queryLower ) ) {
65+ if ( row . unit && textMatchesSearch ( row . unit , queryLower ) ) {
6666 return true ;
6767 }
6868 return false ;
6969 case "select" :
7070 if (
71- textMatchesConfigSearch ( row . title , queryLower ) ||
72- textMatchesConfigSearch ( row . desc , queryLower )
71+ textMatchesSearch ( row . title , queryLower ) ||
72+ textMatchesSearch ( row . desc , queryLower )
7373 ) {
7474 return true ;
7575 }
76- return row . options . some ( ( o ) => textMatchesConfigSearch ( o . label ?? String ( o . value ) , queryLower ) ) ;
76+ return row . options . some ( ( o ) => textMatchesSearch ( o . label ?? String ( o . value ) , queryLower ) ) ;
7777 case "button" :
7878 return (
79- textMatchesConfigSearch ( row . title , queryLower ) ||
80- textMatchesConfigSearch ( row . label , queryLower ) ||
81- ( row . desc ? textMatchesConfigSearch ( row . desc , queryLower ) : false )
79+ textMatchesSearch ( row . title , queryLower ) ||
80+ textMatchesSearch ( row . label , queryLower ) ||
81+ ( row . desc ? textMatchesSearch ( row . desc , queryLower ) : false )
8282 ) ;
8383 case "custom" :
84- return row . keywords . some ( ( k ) => textMatchesConfigSearch ( k , queryLower ) ) ;
84+ return row . keywords . some ( ( k ) => textMatchesSearch ( k , queryLower ) ) ;
8585 case "switchQuery" :
86- return switchQuerySearchStrings ( row ) . some ( ( s ) => textMatchesConfigSearch ( s , queryLower ) ) ;
86+ return switchQuerySearchStrings ( row ) . some ( ( s ) => textMatchesSearch ( s , queryLower ) ) ;
8787 case "stack" :
88- return stackExtraSearchStrings ( row ) . some ( ( s ) => textMatchesConfigSearch ( s , queryLower ) ) ;
88+ return stackExtraSearchStrings ( row ) . some ( ( s ) => textMatchesSearch ( s , queryLower ) ) ;
8989 }
9090} ;
9191
@@ -135,7 +135,7 @@ export const filterSettingSections = <T extends {title?: string; items: SettingR
135135 }
136136 const out : T [ ] = [ ] ;
137137 for ( const section of sections ) {
138- if ( textMatchesConfigSearch ( section . title ?? "" , queryLower ) ) {
138+ if ( textMatchesSearch ( section . title ?? "" , queryLower ) ) {
139139 out . push ( section ) ;
140140 continue ;
141141 }
0 commit comments