code: function handleQueryChange(editor, state, initial) {
          setQueryInfo(state, findBar.getQueryInfo());
          updateResultSet(editor);
  
          if (state.parsedQuery) {
              // 3rd arg: prefer to avoid scrolling if result is anywhere within view, since in this case user
              // is in the middle of typing, not navigating explicitly; viewport jumping would be distracting.
              findNext(editor, false, true, state.searchStartPos);
          } else if (!initial) {
              // Blank or invalid query: just jump back to initial pos
              editor._codeMirror.setCursor(state.searchStartPos);
          }
  
          editor.lastParsedQuery = state.parsedQuery;
      }
docs: Called each time the search query field changes. Updates state.parsedQuery (parsedQuery will be falsy if the field
  was blank OR contained a regexp with invalid syntax). Then calls updateResultSet(), and then jumps to
  the first matching result, starting from the original cursor position.
  @param {!Editor} editor The editor we're searching in.
  @param {Object} state The current query state.
  @param {boolean} initial Whether this is the initial population of the query when the search bar opens.
  In that case, we don't want to change the selection unnecessarily.