code: def history_forward(self, count=1):
          
          self._set_history_search()
  
          # Go forward in history.
          found_something = False
  
          for i in range(self.working_index + 1, len(self._working_lines)):
              if self._history_matches(i):
                  self.working_index = i
                  count -= 1
                  found_something = True
              if count == 0:
                  break
  
          # If we found an entry, move cursor to the end of the first line.
          if found_something:
              self.cursor_position = 0
              self.cursor_position += self.document.get_end_of_line_position()
docs: Move forwards through the history.
  
          :param count: Amount of items to move forward.