anchor.diff:                      failwith "No search in progress"
   
               member private x.CmdReverseSearch () =
  -                match searchState with
  +                match st.SearchState with
                   | None ->
  -                    searchState <- Some { MatchAt = -1; Term = ""; Direction = SearchDirection.Backward}
  +                    st <- { st with SearchState = Some { MatchAt = -1; Term = ""; Direction = SearchDirection.Backward } }
                       x.SetSearchPrompt ("")
                   | Some(search) ->
                       if search.Term = "" then
  -                        match previousSearch with
  +                        match st.PreviousSearch with
                           | None | Some("") ->
                               ()
                           | Some(previousTerm) -> 
  -                            searchState <- Some { search with Term = previousTerm}
  +                            st <- { st with SearchState = Some { search with Term = previousTerm } }
                               x.SetSearchPrompt previousTerm
                               x.ReverseSearch ()
                       else
  
positive.code:                 AutoCompleteEvent = None
                  SearchState = None
                  PreviousSearch = None
                  LastCommand = new Command()
              }
  
          type LineEditor (name : string option, histsize : int) as x =
  
negative.code:                 if pos <> -1 then
                      let k = st.Text.Substring (pos, st.Cursor-pos)
              
                      let newKillBuffer = if st.LastCommand = Some(Command.DeleteBackword) then st.KillBuffer + k else k
                      let newText = st.Text.Remove (pos, st.Cursor-pos)
                      st <- { st with KillBuffer = newKillBuffer; Text = newText; RenderedText = render newText }
  
  