@@ -174,8 +174,8 @@ impl<'a> FFFQuery<'a> {
174174 /// with the leading `\` stripped, since the backslash is only an escape
175175 /// signal to the parser and should not appear in the final pattern.
176176 ///
177- /// `FuzzyQuery::Empty` → empty string
178- /// `FuzzyQuery::Text("foo")` → `"foo"`
177+ /// `FuzzyQuery::Empty` → empty string
178+ /// `FuzzyQuery::Text("foo")` → `"foo"`
179179 /// `FuzzyQuery::Parts(["a", "\\*.rs", "b"])` → `"a *.rs b"`
180180 pub fn grep_text ( & self ) -> String {
181181 match & self . fuzzy_query {
@@ -365,7 +365,7 @@ fn parse_token_without_negation<'a, C: ParserConfig>(
365365 "type" if config. enable_type_filter ( ) => {
366366 return Some ( Constraint :: FileType ( value) ) ;
367367 }
368- "status" | "gi " | "g" | "st " if config. enable_git_status ( ) => {
368+ "status" | "st " | "g" | "git " if config. enable_git_status ( ) => {
369369 return parse_git_status ( value) ;
370370 }
371371 _ => { }
@@ -586,6 +586,29 @@ mod tests {
586586 }
587587 }
588588
589+ #[ test]
590+ fn test_negation_git_status_all_key_aliases ( ) {
591+ let parser = QueryParser :: new ( FileSearchConfig ) ;
592+ for key in [ "status" , "st" , "g" , "git" ] {
593+ let query = format ! ( "!{key}:modified foo" ) ;
594+ let result = parser. parse ( & query) ;
595+ assert_eq ! (
596+ result. constraints. len( ) ,
597+ 1 ,
598+ "!{key}:modified should produce exactly one constraint"
599+ ) ;
600+ match & result. constraints [ 0 ] {
601+ Constraint :: Not ( inner) => assert ! (
602+ matches!( * * inner, Constraint :: GitStatus ( GitStatusFilter :: Modified ) ) ,
603+ "!{key}:modified expected Not(GitStatus(Modified)), got Not({inner:?})"
604+ ) ,
605+ other => {
606+ panic ! ( "!{key}:modified expected Not(GitStatus), got {other:?}" )
607+ }
608+ }
609+ }
610+ }
611+
589612 #[ test]
590613 fn test_backslash_escape_extension ( ) {
591614 let parser = QueryParser :: new ( FileSearchConfig ) ;
0 commit comments