code: def _history_matches(self, i):
          
          return (self.history_search_text is None or
                  self._working_lines[i].startswith(self.history_search_text))
docs: True when the current entry matches the history search.
          (when we don't have history search, it's also True.)