anchor.diff:                  AutoCompleteEvent = None
               }
   
  +        type SearchState =
  +            {
  +                /// Current search direction
  +                Direction: SearchDirection
  +
  +                // The position where we found the match
  +                MatchAt: int
  +
  +                // The string being searched for
  +                Term: string
  +            }
  +
           type LineEditor (name : string option, histsize : int) as x =
               // The text being edited.
               let mutable text = new StringBuilder ()
  
positive.code: 
              let mutable state = makeGlobalState name histsize
  
              // The string being searched for
              let mutable search : string = null
              let mutable last_search : string = null
  
              // whether we are searching (-1= reverse; 0 = no; 1 = forward)
              let mutable searching : SearchDirection option = None
  
              // The position where we found the match.
              let mutable match_at : int = 0
          
              // Used to implement the Kill semantics (multiple Alt-Ds accumulate)
              let mutable last_command : Command = new Command()
  
negative.code:                         handler_index <- handler_index + 1
  
                      if handled then
                          match (searchState, last_command) with
                          | ( _, Command.ReverseSearch) -> ()
                          | (Some(search), _) -> 
                              previousSearch <- Some(search.Term)
                              searchState <- None
                              x.SetPrompt (specified_prompt)
                          | _ -> ()
                     
  