File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -230,12 +230,17 @@ impl LsColors {
230230 let parts: Vec < _ > = entry. split ( '=' ) . collect ( ) ;
231231
232232 if let Some ( [ entry, ansi_style] ) = parts. get ( 0 ..2 ) {
233- if let Some ( style) = Style :: from_ansi_sequence ( ansi_style) {
234- if entry. starts_with ( '*' ) {
233+ let style = Style :: from_ansi_sequence ( ansi_style) ;
234+ if let Some ( suffix) = entry. strip_prefix ( '*' ) {
235+ if let Some ( style) = style {
235236 self . suffix_mapping
236- . push ( ( entry[ 1 ..] . to_string ( ) . to_ascii_lowercase ( ) , style) ) ;
237- } else if let Some ( indicator) = Indicator :: from ( entry) {
237+ . push ( ( suffix. to_string ( ) . to_ascii_lowercase ( ) , style) ) ;
238+ }
239+ } else if let Some ( indicator) = Indicator :: from ( entry) {
240+ if let Some ( style) = style {
238241 self . indicator_mapping . insert ( indicator, style) ;
242+ } else {
243+ self . indicator_mapping . remove ( & indicator) ;
239244 }
240245 }
241246 }
You can’t perform that action at this time.
0 commit comments